Prefer defvar-local in cedet
* lisp/cedet/ede.el (ede-object-root-project) (ede-object-project, ede-object): * lisp/cedet/mode-local.el (mode-local-symbol-table): * lisp/cedet/semantic.el (semantic--parse-table) (semantic-symbol->name-assoc-list) (semantic-symbol->name-assoc-list-for-type-parts) (semantic-case-fold, semantic--buffer-cache) (semantic-unmatched-syntax-cache) (semantic-unmatched-syntax-cache-check, semantic-parser-name) (semantic--completion-cache, semantic-parse-tree-state) (semantic-init-mode-hook, semantic-parser-warnings): * lisp/cedet/semantic/bovine.el (semantic-bovinate-nonterminal-check-obarray): * lisp/cedet/semantic/complete.el (semantic-collector-per-buffer-list): * lisp/cedet/semantic/ctxt.el (semantic-command-separation-character) (semantic-function-argument-separation-character): * lisp/cedet/semantic/db-find.el (semanticdb-find-lost-includes) (semanticdb-find-scanned-include-tags): * lisp/cedet/semantic/db.el (semanticdb-new-database-class) (semanticdb-default-find-index-class) (semanticdb-current-database, semanticdb-current-table) (semanticdb-project-system-databases) (semanticdb-out-of-buffer-create-table-fcn): * lisp/cedet/semantic/debug.el (semantic-debug-parser-source) (semantic-debug-parser-class) (semantic-debug-parser-debugger-source): * lisp/cedet/semantic/dep.el (semantic-dependency-include-path) (semantic-dependency-system-include-path): * lisp/cedet/semantic/format.el (semantic-function-argument-separator) (semantic-format-parent-separator): * lisp/cedet/semantic/fw.el (semantic-new-buffer-fcn-was-run): * lisp/cedet/semantic/grammar.el (semantic-grammar-macros) (semantic--grammar-macros-regexp-1) (semantic--grammar-macros-regexp-2): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-mode): * lisp/cedet/semantic/imenu.el (semantic-imenu-expandable-tag-classes): * lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-macro-symbol-obarray) (semantic-lex-spp-project-macro-symbol-obarray) (semantic-lex-spp-dynamic-macro-symbol-obarray) (semantic-lex-spp-dynamic-macro-symbol-obarray-stack): * lisp/cedet/semantic/lex.el (semantic-flex-keywords-obarray) (semantic-lex-types-obarray, semantic-lex-analyzer) (semantic-lex-syntax-modifications, semantic-lex-syntax-table) (semantic-lex-comment-regex, semantic-lex-number-expression) (semantic-lex-depth, semantic-flex-extensions) (semantic-flex-syntax-modifications, semantic-ignore-comments) (semantic-flex-enable-newlines, semantic-flex-enable-whitespace) (semantic-flex-enable-bol, semantic-number-expression) (semantic-flex-depth): * lisp/cedet/semantic/senator.el (senator-isearch-semantic-mode): * lisp/cedet/semantic/sort.el (semantic-orphaned-member-metaparent-type): * lisp/cedet/semantic/tag.el (semantic-tag-expand-function): * lisp/cedet/semantic/util-modes.el (semantic-show-parser-state-string) (semantic-stickyfunc-sticky-classes) (semantic-highlight-func-ct-overlay): * lisp/cedet/semantic/util.el (semantic-type-relation-separator-character) (semantic-equivalent-major-modes): * lisp/cedet/semantic/wisent.el (wisent-error-function) (wisent-lexer-function): Prefer defvar-local.
This commit is contained in:
parent
21d9303c61
commit
834ba2b619
23 changed files with 71 additions and 145 deletions
|
@ -140,22 +140,19 @@ specified by `ede-project-directories'."
|
|||
(defvar ede-projects nil
|
||||
"A list of all active projects currently loaded in Emacs.")
|
||||
|
||||
(defvar ede-object-root-project nil
|
||||
(defvar-local ede-object-root-project nil
|
||||
"The current buffer's current root project.
|
||||
If a file is under a project, this specifies the project that is at
|
||||
the root of a project tree.")
|
||||
(make-variable-buffer-local 'ede-object-root-project)
|
||||
|
||||
(defvar ede-object-project nil
|
||||
(defvar-local ede-object-project nil
|
||||
"The current buffer's current project at that level.
|
||||
If a file is under a project, this specifies the project that contains the
|
||||
current target.")
|
||||
(make-variable-buffer-local 'ede-object-project)
|
||||
|
||||
(defvar ede-object nil
|
||||
(defvar-local ede-object nil
|
||||
"The current buffer's target object.
|
||||
This object's class determines how to compile and debug from a buffer.")
|
||||
(make-variable-buffer-local 'ede-object)
|
||||
|
||||
(defvar ede-selected-object nil
|
||||
"The currently user-selected project or target.
|
||||
|
|
|
@ -170,11 +170,10 @@ definition."
|
|||
|
||||
;;; Core bindings API
|
||||
;;
|
||||
(defvar mode-local-symbol-table nil
|
||||
(defvar-local mode-local-symbol-table nil
|
||||
"Buffer local mode bindings.
|
||||
These symbols provide a hook for a `major-mode' to specify specific
|
||||
behaviors. Use the function `mode-local-bind' to define new bindings.")
|
||||
(make-variable-buffer-local 'mode-local-symbol-table)
|
||||
|
||||
(defvar mode-local-active-mode nil
|
||||
"Major mode in which bindings are active.")
|
||||
|
|
|
@ -77,13 +77,12 @@ introduced."
|
|||
|
||||
;;; Variables and Configuration
|
||||
;;
|
||||
(defvar semantic--parse-table nil
|
||||
(defvar-local semantic--parse-table nil
|
||||
"Variable that defines how to parse top level items in a buffer.
|
||||
This variable is for internal use only, and its content depends on the
|
||||
external parser used.")
|
||||
(make-variable-buffer-local 'semantic--parse-table)
|
||||
|
||||
(defvar semantic-symbol->name-assoc-list
|
||||
(defvar-local semantic-symbol->name-assoc-list
|
||||
'((type . "Types")
|
||||
(variable . "Variables")
|
||||
(function . "Functions")
|
||||
|
@ -95,22 +94,19 @@ It is sometimes useful for a language to use a different string
|
|||
in place of the default, even though that language will still
|
||||
return a symbol. For example, Java return's includes, but the
|
||||
string can be replaced with `Imports'.")
|
||||
(make-variable-buffer-local 'semantic-symbol->name-assoc-list)
|
||||
|
||||
(defvar semantic-symbol->name-assoc-list-for-type-parts nil
|
||||
(defvar-local semantic-symbol->name-assoc-list-for-type-parts nil
|
||||
"Like `semantic-symbol->name-assoc-list' for type parts.
|
||||
Some tags that have children (see `semantic-tag-children-compatibility')
|
||||
will want to define the names of classes of tags differently than at
|
||||
the top level. For example, in C++, a Function may be called a
|
||||
Method. In addition, there may be new types of tags that exist only
|
||||
in classes, such as protection labels.")
|
||||
(make-variable-buffer-local 'semantic-symbol->name-assoc-list-for-type-parts)
|
||||
|
||||
(defvar semantic-case-fold nil
|
||||
(defvar-local semantic-case-fold nil
|
||||
"Value for `case-fold-search' when parsing.")
|
||||
(make-variable-buffer-local 'semantic-case-fold)
|
||||
|
||||
(defvar semantic--buffer-cache nil
|
||||
(defvar-local semantic--buffer-cache nil
|
||||
"A cache of the fully parsed buffer.
|
||||
If no significant changes have been made (based on the state) then
|
||||
this is returned instead of re-parsing the buffer.
|
||||
|
@ -120,16 +116,13 @@ this is returned instead of re-parsing the buffer.
|
|||
If you need a tag list, use `semantic-fetch-tags'. If you need the
|
||||
cached values for some reason, chances are you can add a hook to
|
||||
`semantic-after-toplevel-cache-change-hook'.")
|
||||
(make-variable-buffer-local 'semantic--buffer-cache)
|
||||
|
||||
(defvar semantic-unmatched-syntax-cache nil
|
||||
(defvar-local semantic-unmatched-syntax-cache nil
|
||||
"A cached copy of unmatched syntax tokens.")
|
||||
(make-variable-buffer-local 'semantic-unmatched-syntax-cache)
|
||||
|
||||
(defvar semantic-unmatched-syntax-cache-check nil
|
||||
(defvar-local semantic-unmatched-syntax-cache-check nil
|
||||
"Non-nil if the unmatched syntax cache is out of date.
|
||||
This is tracked with `semantic-change-function'.")
|
||||
(make-variable-buffer-local 'semantic-unmatched-syntax-cache-check)
|
||||
|
||||
(defvar semantic-edits-are-safe nil
|
||||
"When non-nil, modifications do not require a reparse.
|
||||
|
@ -180,19 +173,16 @@ during a flush when the cache is given a new value of nil.")
|
|||
:group 'semantic
|
||||
:type 'boolean)
|
||||
|
||||
(defvar semantic-parser-name "LL"
|
||||
(defvar-local semantic-parser-name "LL"
|
||||
"Optional name of the parser used to parse input stream.")
|
||||
(make-variable-buffer-local 'semantic-parser-name)
|
||||
|
||||
(defvar semantic--completion-cache nil
|
||||
(defvar-local semantic--completion-cache nil
|
||||
"Internal variable used by `semantic-complete-symbol'.")
|
||||
(make-variable-buffer-local 'semantic--completion-cache)
|
||||
|
||||
;;; Parse tree state management API
|
||||
;;
|
||||
(defvar semantic-parse-tree-state 'needs-rebuild
|
||||
(defvar-local semantic-parse-tree-state 'needs-rebuild
|
||||
"State of the current parse tree.")
|
||||
(make-variable-buffer-local 'semantic-parse-tree-state)
|
||||
|
||||
(defmacro semantic-parse-tree-unparseable ()
|
||||
"Indicate that the current buffer is unparseable.
|
||||
|
@ -268,9 +258,8 @@ These functions are called by `semantic-new-buffer-fcn', before
|
|||
(defvar semantic-init-hook nil
|
||||
"Hook run when a buffer is initialized with a parsing table.")
|
||||
|
||||
(defvar semantic-init-mode-hook nil
|
||||
(defvar-local semantic-init-mode-hook nil
|
||||
"Hook run when a buffer of a particular mode is initialized.")
|
||||
(make-variable-buffer-local 'semantic-init-mode-hook)
|
||||
|
||||
(defvar semantic-init-db-hook nil
|
||||
"Hook run when a buffer is initialized with a parsing table for DBs.
|
||||
|
@ -729,9 +718,8 @@ This function returns semantic tags without overlays."
|
|||
;;
|
||||
;; Any parser can use this API to provide a list of warnings during a
|
||||
;; parse which a user may want to investigate.
|
||||
(defvar semantic-parser-warnings nil
|
||||
(defvar-local semantic-parser-warnings nil
|
||||
"A list of parser warnings since the last full reparse.")
|
||||
(make-variable-buffer-local 'semantic-parser-warnings)
|
||||
|
||||
(defun semantic-clear-parser-warnings ()
|
||||
"Clear the current list of parser warnings for this buffer."
|
||||
|
|
|
@ -41,10 +41,9 @@
|
|||
|
||||
;;; Variables
|
||||
;;
|
||||
(defvar semantic-bovinate-nonterminal-check-obarray nil
|
||||
(defvar-local semantic-bovinate-nonterminal-check-obarray nil
|
||||
"Obarray of streams already parsed for nonterminal symbols.
|
||||
Use this to detect infinite recursion during a parse.")
|
||||
(make-variable-buffer-local 'semantic-bovinate-nonterminal-check-obarray)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -867,9 +867,8 @@ Expected return values are:
|
|||
;; * semantic-collector-try-completion
|
||||
;; * semantic-collector-all-completions
|
||||
|
||||
(defvar semantic-collector-per-buffer-list nil
|
||||
(defvar-local semantic-collector-per-buffer-list nil
|
||||
"List of collectors active in this buffer.")
|
||||
(make-variable-buffer-local 'semantic-collector-per-buffer-list)
|
||||
|
||||
(defvar semantic-collector-list nil
|
||||
"List of global collectors active this session.")
|
||||
|
|
|
@ -32,17 +32,15 @@
|
|||
(require 'semantic)
|
||||
|
||||
;;; Code:
|
||||
(defvar semantic-command-separation-character
|
||||
(defvar-local semantic-command-separation-character
|
||||
";"
|
||||
"String which indicates the end of a command.
|
||||
Used for identifying the end of a single command.")
|
||||
(make-variable-buffer-local 'semantic-command-separation-character)
|
||||
|
||||
(defvar semantic-function-argument-separation-character
|
||||
(defvar-local semantic-function-argument-separation-character
|
||||
","
|
||||
"String which indicates the end of an argument.
|
||||
Used for identifying arguments to functions.")
|
||||
(make-variable-buffer-local 'semantic-function-argument-separation-character)
|
||||
|
||||
;;; Local Contexts
|
||||
;;
|
||||
|
|
|
@ -426,17 +426,15 @@ Default action as described in `semanticdb-find-translate-path'."
|
|||
;; searchable item, then instead do the regular thing without caching.
|
||||
(semanticdb-find-translate-path-includes--internal path))))
|
||||
|
||||
(defvar semanticdb-find-lost-includes nil
|
||||
(defvar-local semanticdb-find-lost-includes nil
|
||||
"Include files that we cannot find associated with this buffer.")
|
||||
(make-variable-buffer-local 'semanticdb-find-lost-includes)
|
||||
|
||||
(defvar semanticdb-find-scanned-include-tags nil
|
||||
(defvar-local semanticdb-find-scanned-include-tags nil
|
||||
"All include tags scanned, plus action taken on the tag.
|
||||
Each entry is an alist:
|
||||
(ACTION . TAG)
|
||||
where ACTION is one of `scanned', `duplicate', `lost'
|
||||
and TAG is a clone of the include tag that was found.")
|
||||
(make-variable-buffer-local 'semanticdb-find-scanned-include-tags)
|
||||
|
||||
(defvar semanticdb-implied-include-tags nil
|
||||
"Include tags implied for all files of a given mode.
|
||||
|
|
|
@ -50,27 +50,23 @@
|
|||
(defvar semanticdb-database-list nil
|
||||
"List of all active databases.")
|
||||
|
||||
(defvar semanticdb-new-database-class 'semanticdb-project-database-file
|
||||
(defvar-local semanticdb-new-database-class 'semanticdb-project-database-file
|
||||
"The default type of database created for new files.
|
||||
This can be changed on a per file basis, so that some directories
|
||||
are saved using one mechanism, and some directories via a different
|
||||
mechanism.")
|
||||
(make-variable-buffer-local 'semanticdb-new-database-class)
|
||||
|
||||
(defvar semanticdb-default-find-index-class 'semanticdb-find-search-index
|
||||
(defvar-local semanticdb-default-find-index-class 'semanticdb-find-search-index
|
||||
"The default type of search index to use for a `semanticdb-table's.
|
||||
This can be changed to try out new types of search indices.")
|
||||
(make-variable-buffer-local 'semanticdb-default-find=index-class)
|
||||
|
||||
;;;###autoload
|
||||
(defvar semanticdb-current-database nil
|
||||
(defvar-local semanticdb-current-database nil
|
||||
"For a given buffer, this is the currently active database.")
|
||||
(make-variable-buffer-local 'semanticdb-current-database)
|
||||
|
||||
;;;###autoload
|
||||
(defvar semanticdb-current-table nil
|
||||
(defvar-local semanticdb-current-table nil
|
||||
"For a given buffer, this is the currently active database table.")
|
||||
(make-variable-buffer-local 'semanticdb-current-table)
|
||||
|
||||
;;; ABSTRACT CLASSES
|
||||
;;
|
||||
|
@ -825,13 +821,12 @@ must return a string, (the root directory) or a list of strings (multiple
|
|||
root directories in a more complex system). This variable should be used
|
||||
by project management programs like EDE or JDE.")
|
||||
|
||||
(defvar semanticdb-project-system-databases nil
|
||||
(defvar-local semanticdb-project-system-databases nil
|
||||
"List of databases containing system library information.
|
||||
Mode authors can create their own system databases which know
|
||||
detailed information about the system libraries for querying purposes.
|
||||
Put those into this variable as a buffer-local, or mode-local
|
||||
value.")
|
||||
(make-variable-buffer-local 'semanticdb-project-system-databases)
|
||||
|
||||
(defvar semanticdb-search-system-databases t
|
||||
"Non-nil if search routines are to include a system database.")
|
||||
|
@ -1016,10 +1011,9 @@ DONTLOAD does not affect the creation of new database objects."
|
|||
)
|
||||
)))
|
||||
|
||||
(defvar semanticdb-out-of-buffer-create-table-fcn nil
|
||||
(defvar-local semanticdb-out-of-buffer-create-table-fcn nil
|
||||
"When non-nil, a function for creating a semanticdb table.
|
||||
This should take a filename to be parsed.")
|
||||
(make-variable-buffer-local 'semanticdb-out-of-buffer-create-table-fcn)
|
||||
|
||||
(defun semanticdb-create-table-for-file-not-in-buffer (filename)
|
||||
"Create a table for the file FILENAME.
|
||||
|
|
|
@ -44,24 +44,18 @@
|
|||
;;; Code:
|
||||
|
||||
;;;###autoload
|
||||
(defvar semantic-debug-parser-source nil
|
||||
(defvar-local semantic-debug-parser-source nil
|
||||
"For any buffer, the file name (no path) of the parser.
|
||||
This would be a parser for a specific language, not the source
|
||||
to one of the parser generators.")
|
||||
;;;###autoload
|
||||
(make-variable-buffer-local 'semantic-debug-parser-source)
|
||||
|
||||
;;;###autoload
|
||||
(defvar semantic-debug-parser-class nil
|
||||
(defvar-local semantic-debug-parser-class nil
|
||||
"Class to create when building a debug parser object.")
|
||||
;;;###autoload
|
||||
(make-variable-buffer-local 'semantic-debug-parser-class)
|
||||
|
||||
;;;###autoload
|
||||
(defvar semantic-debug-parser-debugger-source nil
|
||||
(defvar-local semantic-debug-parser-debugger-source nil
|
||||
"Location of the debug parser class.")
|
||||
;;;###autoload
|
||||
(make-variable-buffer-local 'semantic-debug-parser-source)
|
||||
|
||||
(defvar semantic-debug-enabled nil
|
||||
"Non-nil when debugging a parser.")
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(defvar semantic-dependency-include-path nil
|
||||
(defvar-local semantic-dependency-include-path nil
|
||||
"Defines the include path used when searching for files.
|
||||
This should be a list of directories to search which is specific
|
||||
to the file being included.
|
||||
|
@ -56,9 +56,8 @@ reparsed, the cache will be reset.
|
|||
TODO: use ffap.el to locate such items?
|
||||
|
||||
NOTE: Obsolete this, or use as special user")
|
||||
(make-variable-buffer-local 'semantic-dependency-include-path)
|
||||
|
||||
(defvar semantic-dependency-system-include-path nil
|
||||
(defvar-local semantic-dependency-system-include-path nil
|
||||
"Defines the system include path.
|
||||
This should be set with either `defvar-mode-local', or with
|
||||
`semantic-add-system-include'.
|
||||
|
@ -71,7 +70,6 @@ When searching for a file associated with a name found in a tag of
|
|||
class include, this path will be inspected for includes of type
|
||||
`system'. Some include tags are agnostic to this setting and will
|
||||
check both the project and system directories.")
|
||||
(make-variable-buffer-local 'semantic-dependency-system-include-path)
|
||||
|
||||
(defmacro defcustom-mode-local-semantic-dependency-system-include-path
|
||||
(mode name value &optional docstring)
|
||||
|
|
|
@ -78,13 +78,11 @@ Images can be used as icons instead of some types of text strings."
|
|||
:group 'semantic
|
||||
:type 'boolean)
|
||||
|
||||
(defvar semantic-function-argument-separator ","
|
||||
(defvar-local semantic-function-argument-separator ","
|
||||
"Text used to separate arguments when creating text from tags.")
|
||||
(make-variable-buffer-local 'semantic-function-argument-separator)
|
||||
|
||||
(defvar semantic-format-parent-separator "::"
|
||||
(defvar-local semantic-format-parent-separator "::"
|
||||
"Text used to separate names when between namespaces/classes and functions.")
|
||||
(make-variable-buffer-local 'semantic-format-parent-separator)
|
||||
|
||||
(defvar semantic-format-face-alist
|
||||
`( (function . font-lock-function-name-face)
|
||||
|
|
|
@ -243,9 +243,8 @@ Avoid using a large BODY since it is duplicated."
|
|||
;;; Misc utilities
|
||||
;;
|
||||
|
||||
(defvar semantic-new-buffer-fcn-was-run nil
|
||||
(defvar-local semantic-new-buffer-fcn-was-run nil
|
||||
"Non-nil after `semantic-new-buffer-fcn' has been executed.")
|
||||
(make-variable-buffer-local 'semantic-new-buffer-fcn-was-run)
|
||||
|
||||
(defsubst semantic-active-p ()
|
||||
"Return non-nil if the current buffer was set up for parsing."
|
||||
|
|
|
@ -432,9 +432,8 @@ Also load the specified macro libraries."
|
|||
defs)))
|
||||
(nreverse defs)))
|
||||
|
||||
(defvar semantic-grammar-macros nil
|
||||
(defvar-local semantic-grammar-macros nil
|
||||
"List of associations (MACRO-NAME . EXPANDER).")
|
||||
(make-variable-buffer-local 'semantic-grammar-macros)
|
||||
|
||||
(defun semantic-grammar-macros ()
|
||||
"Build and return the alist of defined macros."
|
||||
|
@ -1054,8 +1053,7 @@ See also the variable `semantic-grammar-file-regexp'."
|
|||
;;;; Macros highlighting
|
||||
;;;;
|
||||
|
||||
(defvar semantic--grammar-macros-regexp-1 nil)
|
||||
(make-variable-buffer-local 'semantic--grammar-macros-regexp-1)
|
||||
(defvar-local semantic--grammar-macros-regexp-1 nil)
|
||||
|
||||
(defun semantic--grammar-macros-regexp-1 ()
|
||||
"Return font-lock keyword regexp for pre-installed macro names."
|
||||
|
@ -1076,8 +1074,7 @@ See also the variable `semantic-grammar-file-regexp'."
|
|||
"\\<%use-macros\\>[ \t\r\n]+\\(\\sw\\|\\s_\\)+[ \t\r\n]+{"
|
||||
"Regexp that matches a macro declaration statement.")
|
||||
|
||||
(defvar semantic--grammar-macros-regexp-2 nil)
|
||||
(make-variable-buffer-local 'semantic--grammar-macros-regexp-2)
|
||||
(defvar-local semantic--grammar-macros-regexp-2 nil)
|
||||
|
||||
(defun semantic--grammar-clear-macros-regexp-2 (&rest _)
|
||||
"Clear the cached regexp that match macros local in this grammar.
|
||||
|
|
|
@ -135,10 +135,9 @@ it is unlikely the user would be ready to type again right away."
|
|||
:group 'semantic
|
||||
:type 'hook)
|
||||
|
||||
(defvar semantic-idle-scheduler-mode nil
|
||||
(defvar-local semantic-idle-scheduler-mode nil
|
||||
"Non-nil if idle-scheduler minor mode is enabled.
|
||||
Use the command `semantic-idle-scheduler-mode' to change this variable.")
|
||||
(make-variable-buffer-local 'semantic-idle-scheduler-mode)
|
||||
|
||||
(defcustom semantic-idle-scheduler-max-buffer-size 0
|
||||
"Maximum size in bytes of buffers where idle-scheduler is enabled.
|
||||
|
|
|
@ -136,12 +136,11 @@ other buffer local ones based on the same semanticdb."
|
|||
"Non-nil if `semantic-imenu-rebuild-directory-indexes' is running.")
|
||||
|
||||
;;;###autoload
|
||||
(defvar semantic-imenu-expandable-tag-classes '(type)
|
||||
(defvar-local semantic-imenu-expandable-tag-classes '(type)
|
||||
"List of expandable tag classes.
|
||||
Tags of those classes will be given submenu with children.
|
||||
By default, a `type' has interesting children. In Texinfo, however, a
|
||||
`section' has interesting children.")
|
||||
(make-variable-buffer-local 'semantic-imenu-expandable-tag-classes)
|
||||
|
||||
;;; Code:
|
||||
(defun semantic-imenu-tag-overlay (tag)
|
||||
|
|
|
@ -73,28 +73,24 @@
|
|||
(declare-function c-end-of-macro "cc-engine")
|
||||
|
||||
;;; Code:
|
||||
(defvar semantic-lex-spp-macro-symbol-obarray nil
|
||||
(defvar-local semantic-lex-spp-macro-symbol-obarray nil
|
||||
"Table of macro keywords used by the Semantic Preprocessor.
|
||||
These symbols will be used in addition to those in
|
||||
`semantic-lex-spp-dynamic-macro-symbol-obarray'.")
|
||||
(make-variable-buffer-local 'semantic-lex-spp-macro-symbol-obarray)
|
||||
|
||||
(defvar semantic-lex-spp-project-macro-symbol-obarray nil
|
||||
(defvar-local semantic-lex-spp-project-macro-symbol-obarray nil
|
||||
"Table of macro keywords for this project.
|
||||
These symbols will be used in addition to those in
|
||||
`semantic-lex-spp-dynamic-macro-symbol-obarray'.")
|
||||
(make-variable-buffer-local 'semantic-lex-spp-project-macro-symbol-obarray)
|
||||
|
||||
(defvar semantic-lex-spp-dynamic-macro-symbol-obarray nil
|
||||
(defvar-local semantic-lex-spp-dynamic-macro-symbol-obarray nil
|
||||
"Table of macro keywords used during lexical analysis.
|
||||
Macros are lexical symbols which are replaced by other lexical
|
||||
tokens during lexical analysis. During analysis symbols can be
|
||||
added and removed from this symbol table.")
|
||||
(make-variable-buffer-local 'semantic-lex-spp-dynamic-macro-symbol-obarray)
|
||||
|
||||
(defvar semantic-lex-spp-dynamic-macro-symbol-obarray-stack nil
|
||||
(defvar-local semantic-lex-spp-dynamic-macro-symbol-obarray-stack nil
|
||||
"A stack of obarrays for temporarily scoped macro values.")
|
||||
(make-variable-buffer-local 'semantic-lex-spp-dynamic-macro-symbol-obarray-stack)
|
||||
|
||||
(defvar semantic-lex-spp-expanded-macro-stack nil
|
||||
"The stack of lexical SPP macros we have expanded.")
|
||||
|
|
|
@ -202,10 +202,9 @@ as a PROPERTY value. FUN receives a symbol as argument."
|
|||
;; These keywords are keywords defined for using in a grammar with the
|
||||
;; %keyword declaration, and are not keywords used in Emacs Lisp.
|
||||
|
||||
(defvar semantic-flex-keywords-obarray nil
|
||||
(defvar-local semantic-flex-keywords-obarray nil
|
||||
"Buffer local keyword obarray for the lexical analyzer.
|
||||
These keywords are matched explicitly, and converted into special symbols.")
|
||||
(make-variable-buffer-local 'semantic-flex-keywords-obarray)
|
||||
|
||||
(defmacro semantic-lex-keyword-invalid (name)
|
||||
"Signal that NAME is an invalid keyword name."
|
||||
|
@ -333,9 +332,8 @@ so that analysis can continue, if possible."
|
|||
;; with the %type declaration. Types represent different syntaxes.
|
||||
;; See code for `semantic-lex-preset-default-types' for the classic
|
||||
;; types of syntax.
|
||||
(defvar semantic-lex-types-obarray nil
|
||||
(defvar-local semantic-lex-types-obarray nil
|
||||
"Buffer local types obarray for the lexical analyzer.")
|
||||
(make-variable-buffer-local 'semantic-lex-types-obarray)
|
||||
|
||||
(defun semantic-lex-type-invalid (type)
|
||||
"Signal that TYPE is an invalid lexical type name."
|
||||
|
@ -472,11 +470,10 @@ PROPERTY set."
|
|||
;;
|
||||
|
||||
;; FIXME change to non-obsolete default.
|
||||
(defvar semantic-lex-analyzer 'semantic-flex
|
||||
(defvar-local semantic-lex-analyzer 'semantic-flex
|
||||
"The lexical analyzer used for a given buffer.
|
||||
See `semantic-lex' for documentation.
|
||||
For compatibility with Semantic 1.x it defaults to `semantic-flex'.")
|
||||
(make-variable-buffer-local 'semantic-lex-analyzer)
|
||||
|
||||
(defvar semantic-lex-tokens
|
||||
'(
|
||||
|
@ -558,7 +555,7 @@ The key to this alist is the symbol representing token type that
|
|||
- whitespace: Characters that match `\\s-+' regexp.
|
||||
This token is produced with `semantic-lex-whitespace'.")
|
||||
|
||||
(defvar semantic-lex-syntax-modifications nil
|
||||
(defvar-local semantic-lex-syntax-modifications nil
|
||||
"Changes to the syntax table for this buffer.
|
||||
These changes are active only while the buffer is being flexed.
|
||||
This is a list where each element has the form:
|
||||
|
@ -566,20 +563,17 @@ This is a list where each element has the form:
|
|||
CHAR is the char passed to `modify-syntax-entry',
|
||||
and CLASS is the string also passed to `modify-syntax-entry' to define
|
||||
what syntax class CHAR has.")
|
||||
(make-variable-buffer-local 'semantic-lex-syntax-modifications)
|
||||
|
||||
(defvar semantic-lex-syntax-table nil
|
||||
(defvar-local semantic-lex-syntax-table nil
|
||||
"Syntax table used by lexical analysis.
|
||||
See also `semantic-lex-syntax-modifications'.")
|
||||
(make-variable-buffer-local 'semantic-lex-syntax-table)
|
||||
|
||||
(defvar semantic-lex-comment-regex nil
|
||||
(defvar-local semantic-lex-comment-regex nil
|
||||
"Regular expression for identifying comment start during lexical analysis.
|
||||
This may be automatically set when semantic initializes in a mode, but
|
||||
may need to be overridden for some special languages.")
|
||||
(make-variable-buffer-local 'semantic-lex-comment-regex)
|
||||
|
||||
(defvar semantic-lex-number-expression
|
||||
(defvar-local semantic-lex-number-expression
|
||||
;; This expression was written by David Ponce for Java, and copied
|
||||
;; here for C and any other similar language.
|
||||
(eval-when-compile
|
||||
|
@ -628,12 +622,10 @@ FLOATING_POINT_LITERAL:
|
|||
| [0-9]+<EXPONENT>[fFdD]?
|
||||
| [0-9]+<EXPONENT>?[fFdD]
|
||||
;")
|
||||
(make-variable-buffer-local 'semantic-lex-number-expression)
|
||||
|
||||
(defvar semantic-lex-depth 0
|
||||
(defvar-local semantic-lex-depth 0
|
||||
"Default lexing depth.
|
||||
This specifies how many lists to create tokens in.")
|
||||
(make-variable-buffer-local 'semantic-lex-depth)
|
||||
|
||||
(defvar semantic-lex-unterminated-syntax-end-function
|
||||
(lambda (_syntax _syntax-start lex-end) lex-end)
|
||||
|
@ -1768,7 +1760,7 @@ when finding unterminated syntax.")
|
|||
(make-obsolete-variable 'semantic-flex-unterminated-syntax-end-function
|
||||
nil "28.1")
|
||||
|
||||
(defvar semantic-flex-extensions nil
|
||||
(defvar-local semantic-flex-extensions nil
|
||||
"Buffer local extensions to the lexical analyzer.
|
||||
This should contain an alist with a key of a regex and a data element of
|
||||
a function. The function should both move point, and return a lexical
|
||||
|
@ -1777,10 +1769,9 @@ token of the form:
|
|||
nil is also a valid return value.
|
||||
TYPE can be any type of symbol, as long as it doesn't occur as a
|
||||
nonterminal in the language definition.")
|
||||
(make-variable-buffer-local 'semantic-flex-extensions)
|
||||
(make-obsolete-variable 'semantic-flex-extensions nil "28.1")
|
||||
|
||||
(defvar semantic-flex-syntax-modifications nil
|
||||
(defvar-local semantic-flex-syntax-modifications nil
|
||||
"Changes to the syntax table for this buffer.
|
||||
These changes are active only while the buffer is being flexed.
|
||||
This is a list where each element has the form:
|
||||
|
@ -1788,47 +1779,40 @@ This is a list where each element has the form:
|
|||
CHAR is the char passed to `modify-syntax-entry',
|
||||
and CLASS is the string also passed to `modify-syntax-entry' to define
|
||||
what syntax class CHAR has.")
|
||||
(make-variable-buffer-local 'semantic-flex-syntax-modifications)
|
||||
(make-obsolete-variable 'semantic-flex-syntax-modifications nil "28.1")
|
||||
|
||||
(defvar semantic-ignore-comments t
|
||||
(defvar-local semantic-ignore-comments t
|
||||
"Default comment handling.
|
||||
The value t means to strip comments when flexing; nil means
|
||||
to keep comments as part of the token stream.")
|
||||
(make-variable-buffer-local 'semantic-ignore-comments)
|
||||
(make-obsolete-variable 'semantic-ignore-comments nil "28.1")
|
||||
|
||||
(defvar semantic-flex-enable-newlines nil
|
||||
(defvar-local semantic-flex-enable-newlines nil
|
||||
"When flexing, report newlines as syntactic elements.
|
||||
Useful for languages where the newline is a special case terminator.
|
||||
Only set this on a per mode basis, not globally.")
|
||||
(make-variable-buffer-local 'semantic-flex-enable-newlines)
|
||||
(make-obsolete-variable 'semantic-flex-enable-newlines nil "28.1")
|
||||
|
||||
(defvar semantic-flex-enable-whitespace nil
|
||||
(defvar-local semantic-flex-enable-whitespace nil
|
||||
"When flexing, report whitespace as syntactic elements.
|
||||
Useful for languages where the syntax is whitespace dependent.
|
||||
Only set this on a per mode basis, not globally.")
|
||||
(make-variable-buffer-local 'semantic-flex-enable-whitespace)
|
||||
(make-obsolete-variable 'semantic-flex-enable-whitespace nil "28.1")
|
||||
|
||||
(defvar semantic-flex-enable-bol nil
|
||||
(defvar-local semantic-flex-enable-bol nil
|
||||
"When flexing, report beginning of lines as syntactic elements.
|
||||
Useful for languages like python which are indentation sensitive.
|
||||
Only set this on a per mode basis, not globally.")
|
||||
(make-variable-buffer-local 'semantic-flex-enable-bol)
|
||||
(make-obsolete-variable 'semantic-flex-enable-bol nil "28.1")
|
||||
|
||||
(defvar semantic-number-expression semantic-lex-number-expression
|
||||
(defvar-local semantic-number-expression semantic-lex-number-expression
|
||||
"See variable `semantic-lex-number-expression'.")
|
||||
(make-variable-buffer-local 'semantic-number-expression)
|
||||
(make-obsolete-variable 'semantic-number-expression
|
||||
'semantic-lex-number-expression "28.1")
|
||||
|
||||
(defvar semantic-flex-depth 0
|
||||
(defvar-local semantic-flex-depth 0
|
||||
"Default flexing depth.
|
||||
This specifies how many lists to create tokens in.")
|
||||
(make-variable-buffer-local 'semantic-flex-depth)
|
||||
(make-obsolete-variable 'semantic-flex-depth nil "28.1")
|
||||
|
||||
(provide 'semantic/lex)
|
||||
|
|
|
@ -601,10 +601,9 @@ Makes C/C++ language like assumptions."
|
|||
)
|
||||
(t nil)))
|
||||
|
||||
(defvar senator-isearch-semantic-mode nil
|
||||
(defvar-local senator-isearch-semantic-mode nil
|
||||
"Non-nil if isearch does semantic search.
|
||||
This is a buffer local variable.")
|
||||
(make-variable-buffer-local 'senator-isearch-semantic-mode)
|
||||
|
||||
(defun senator-beginning-of-defun (&optional arg)
|
||||
"Move backward to the beginning of a defun.
|
||||
|
|
|
@ -310,11 +310,10 @@ may re-organize the list with side-effects."
|
|||
;; external members, and bring them together in a cloned copy of the
|
||||
;; class tag.
|
||||
;;
|
||||
(defvar semantic-orphaned-member-metaparent-type "class"
|
||||
(defvar-local semantic-orphaned-member-metaparent-type "class"
|
||||
"In `semantic-adopt-external-members', the type of 'type for metaparents.
|
||||
A metaparent is a made-up type semantic token used to hold the child list
|
||||
of orphaned members of a named type.")
|
||||
(make-variable-buffer-local 'semantic-orphaned-member-metaparent-type)
|
||||
|
||||
(defvar semantic-mark-external-member-function nil
|
||||
"Function called when an externally defined orphan is found.
|
||||
|
|
|
@ -1194,7 +1194,7 @@ See also the function `semantic--expand-tag'."
|
|||
(setq tag (cdr tag)))
|
||||
(null tag)))
|
||||
|
||||
(defvar semantic-tag-expand-function nil
|
||||
(defvar-local semantic-tag-expand-function nil
|
||||
"Function used to expand a tag.
|
||||
It is passed each tag production, and must return a list of tags
|
||||
derived from it, or nil if it does not need to be expanded.
|
||||
|
@ -1207,7 +1207,6 @@ following definition is easily parsed into one tag:
|
|||
|
||||
This function should take this compound tag and turn it into two tags,
|
||||
one for A, and the other for B.")
|
||||
(make-variable-buffer-local 'semantic-tag-expand-function)
|
||||
|
||||
(defun semantic--tag-expand (tag)
|
||||
"Convert TAG from a raw state to a cooked state, and expand it.
|
||||
|
|
|
@ -498,10 +498,9 @@ non-nil if the minor mode is enabled."
|
|||
(semantic-add-minor-mode 'semantic-show-parser-state-mode
|
||||
"")
|
||||
|
||||
(defvar semantic-show-parser-state-string nil
|
||||
(defvar-local semantic-show-parser-state-string nil
|
||||
"String showing the parser state for this buffer.
|
||||
See `semantic-show-parser-state-marker' for details.")
|
||||
(make-variable-buffer-local 'semantic-show-parser-state-string)
|
||||
|
||||
(defun semantic-show-parser-state-marker (&rest ignore)
|
||||
"Set `semantic-show-parser-state-string' to indicate parser state.
|
||||
|
@ -713,10 +712,9 @@ non-nil if the minor mode is enabled."
|
|||
(setq header-line-format semantic-stickyfunc-old-hlf)
|
||||
(kill-local-variable 'semantic-stickyfunc-old-hlf)))))
|
||||
|
||||
(defvar semantic-stickyfunc-sticky-classes
|
||||
(defvar-local semantic-stickyfunc-sticky-classes
|
||||
'(function type)
|
||||
"List of tag classes which stickyfunc will display in the header line.")
|
||||
(make-variable-buffer-local 'semantic-stickyfunc-sticky-classes)
|
||||
|
||||
(defcustom semantic-stickyfunc-show-only-functions-p nil
|
||||
"Non-nil means don't show lines that aren't part of a tag.
|
||||
|
@ -886,9 +884,8 @@ Argument EVENT describes the event that caused this function to be called."
|
|||
)
|
||||
(select-window startwin)))
|
||||
|
||||
(defvar semantic-highlight-func-ct-overlay nil
|
||||
(defvar-local semantic-highlight-func-ct-overlay nil
|
||||
"Overlay used to highlight the tag the cursor is in.")
|
||||
(make-variable-buffer-local 'semantic-highlight-func-ct-overlay)
|
||||
|
||||
(defface semantic-highlight-func-current-tag-face
|
||||
'((((class color) (background dark))
|
||||
|
|
|
@ -39,20 +39,18 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(defvar semantic-type-relation-separator-character '(".")
|
||||
(defvar-local semantic-type-relation-separator-character '(".")
|
||||
"Character strings used to separate a parent/child relationship.
|
||||
This list of strings are used for displaying or finding separators
|
||||
in variable field dereferencing. The first character will be used for
|
||||
display. In C, a type field is separated like this: \"type.field\"
|
||||
thus, the character is a \".\". In C, and additional value of \"->\"
|
||||
would be in the list, so that \"type->field\" could be found.")
|
||||
(make-variable-buffer-local 'semantic-type-relation-separator-character)
|
||||
|
||||
(defvar semantic-equivalent-major-modes nil
|
||||
(defvar-local semantic-equivalent-major-modes nil
|
||||
"List of major modes which are considered equivalent.
|
||||
Equivalent modes share a parser, and a set of override methods.
|
||||
A value of nil means that the current major mode is the only one.")
|
||||
(make-variable-buffer-local 'semantic-equivalent-major-modes)
|
||||
|
||||
(declare-function semanticdb-file-stream "semantic/db" (file))
|
||||
|
||||
|
|
|
@ -93,15 +93,13 @@ it to a form suitable for the Wisent's parser."
|
|||
|
||||
;;; Syntax analysis
|
||||
;;
|
||||
(defvar wisent-error-function nil
|
||||
(defvar-local wisent-error-function nil
|
||||
"Function used to report parse error.
|
||||
By default use the function `wisent-message'.")
|
||||
(make-variable-buffer-local 'wisent-error-function)
|
||||
|
||||
(defvar wisent-lexer-function 'wisent-lex
|
||||
(defvar-local wisent-lexer-function 'wisent-lex
|
||||
"Function used to obtain the next lexical token in input.
|
||||
Should be a lexical analyzer created with `define-wisent-lexer'.")
|
||||
(make-variable-buffer-local 'wisent-lexer-function)
|
||||
|
||||
;; Tag production
|
||||
;;
|
||||
|
|
Loading…
Add table
Reference in a new issue