;;; semantic/decorate/include.el --- Decoration modes for include statements
-;; Copyright (C) 2008-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;;; Code:
;;; FACES AND KEYMAPS
-(defvar semantic-decoratiton-mouse-3 (if (featurep 'xemacs) [ button3 ] [ mouse-3 ])
- "The keybinding lisp object to use for binding the right mouse button.")
+(defvar semantic-decoration-mouse-3 (if (featurep 'xemacs) [ button3 ] [ mouse-3 ])
+ "The keybinding Lisp object to use for binding the right mouse button.")
;;; Includes that are in a happy state!
;;
(defface semantic-decoration-on-includes
nil
- "*Overlay Face used on includes that are not in some other state.
+ "Overlay Face used on includes that are not in some other state.
Used by the decoration style: `semantic-decoration-on-includes'."
:group 'semantic-faces)
(defvar semantic-decoration-on-include-map
(let ((km (make-sparse-keymap)))
- (define-key km semantic-decoratiton-mouse-3 'semantic-decoration-include-menu)
+ (define-key km semantic-decoration-mouse-3 'semantic-decoration-include-menu)
km)
"Keymap used on includes.")
(:background "#900000"))
(((class color) (background light))
(:background "#fff0f0")))
- "*Face used to show includes that cannot be found.
+ "Face used to show includes that cannot be found.
Used by the decoration style: `semantic-decoration-on-unknown-includes'."
:group 'semantic-faces)
(defvar semantic-decoration-on-unknown-include-map
(let ((km (make-sparse-keymap)))
;(define-key km [ mouse-2 ] 'semantic-decoration-unknown-include-describe)
- (define-key km semantic-decoratiton-mouse-3 'semantic-decoration-unknown-include-menu)
+ (define-key km semantic-decoration-mouse-3 'semantic-decoration-unknown-include-menu)
km)
"Keymap used on unparsed includes.")
(:background "#009000"))
(((class color) (background light))
(:background "#f0fdf0")))
- "*Face used to show includes that have no file, but do have a DB table.
+ "Face used to show includes that have no file, but do have a DB table.
Used by the decoration style: `semantic-decoration-on-fileless-includes'."
:group 'semantic-faces)
(defvar semantic-decoration-on-fileless-include-map
(let ((km (make-sparse-keymap)))
;(define-key km [ mouse-2 ] 'semantic-decoration-fileless-include-describe)
- (define-key km semantic-decoratiton-mouse-3 'semantic-decoration-fileless-include-menu)
+ (define-key km semantic-decoration-mouse-3 'semantic-decoration-fileless-include-menu)
km)
"Keymap used on unparsed includes.")
(:background "#555500"))
(((class color) (background light))
(:background "#ffff55")))
- "*Face used to show includes that have not yet been parsed.
+ "Face used to show includes that have not yet been parsed.
Used by the decoration style: `semantic-decoration-on-unparsed-includes'."
:group 'semantic-faces)
(defvar semantic-decoration-on-unparsed-include-map
(let ((km (make-sparse-keymap)))
- (define-key km semantic-decoratiton-mouse-3 'semantic-decoration-unparsed-include-menu)
+ (define-key km semantic-decoration-mouse-3 'semantic-decoration-unparsed-include-menu)
km)
"Keymap used on unparsed includes.")
(defun semantic-decoration-on-includes-highlight-default (tag)
"Highlight the include TAG to show that semantic can't find it."
(let* ((file (semantic-dependency-tag-file tag))
+ ;; Don't actually load includes
+ (semanticdb-find-default-throttle
+ (remq 'unloaded semanticdb-find-default-throttle))
(table (semanticdb-find-table-for-include tag (current-buffer)))
(face nil)
(map nil)
(semanticdb-cache-get
table 'semantic-decoration-unparsed-include-cache)
;; Add a dependency.
- (let ((table semanticdb-current-table))
- (semanticdb-add-reference table tag))
+ (let ((currenttable semanticdb-current-table))
+ (semanticdb-add-reference currenttable tag))
)
))
(princ "Include File: ")
(princ (semantic-format-tag-name tag nil t))
(princ "\n\n")
- (princ "This header file has been marked \"Unknown\".
+ (princ (substitute-command-keys "\
+This header file has been marked \"Unknown\".
This means that Semantic has not been able to locate this file on disk.
When Semantic cannot find an include file, this means that the
or, in your .emacs file do:
- (semantic-add-system-include \"/path/to/include\" '")
+ (semantic-add-system-include \"/path/to/include\" \\='"))
(princ (symbol-name mm))
- (princ ")
+ (princ (substitute-command-keys ")
to add the path to Semantic's search.
need to update `semanticdb-project-roots' or better yet, use `ede'
to manage your project. See the ede manual for projects that will
wrap existing project code for Semantic's benefit.
-")
+"))
(when (or (eq mm 'c++-mode) (eq mm 'c-mode))
(princ "
EDE project that will wrap an existing build system. You can do that
like this in your .emacs file:
- (ede-cpp-root-project \"NAME\" :file \"FILENAME\" :locate-fcn 'MYFCN)
+ (ede-cpp-root-project \"NAME\" :file \"FILENAME\" :locate-fcn \\='MYFCN)
See the CEDET manual, the EDE manual, or the commentary in
ede/cpp-root.el for more.
(when (and (boundp 'ede-object)
(boundp 'ede-object-project)
ede-object)
- (princ " This file's project include search is handled by the EDE object:\n")
+ (princ (substitute-command-keys
+ " This file's project include search is handled by the EDE object:\n"))
(princ " Buffer Target: ")
(princ (object-print ede-object))
(princ "\n")
(princ "\n"))
)))
- (princ "\n This file's system include path is:\n")
+ (princ (substitute-command-keys
+ "\n This file's system include path is:\n"))
(dolist (dir semantic-dependency-system-include-path)
(princ " ")
(princ dir)
any decorated referring includes.")
-(defmethod semantic-reset ((obj semantic-decoration-unparsed-include-cache))
+(cl-defmethod semantic-reset ((obj semantic-decoration-unparsed-include-cache))
"Reset OBJ back to it's empty settings."
(let ((table (oref obj table)))
;; This is a hack. Add in something better?
))
))
-(defmethod semanticdb-partial-synchronize ((cache semantic-decoration-unparsed-include-cache)
+(cl-defmethod semanticdb-partial-synchronize ((cache semantic-decoration-unparsed-include-cache)
new-tags)
"Synchronize CACHE with some NEW-TAGS."
(if (semantic-find-tags-by-class 'include new-tags)
(semantic-reset cache)))
-(defmethod semanticdb-synchronize ((cache semantic-decoration-unparsed-include-cache)
+(cl-defmethod semanticdb-synchronize ((cache semantic-decoration-unparsed-include-cache)
new-tags)
"Synchronize a CACHE with some NEW-TAGS."
(semantic-reset cache))