aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cedet/semantic
diff options
context:
space:
mode:
authorStefan Monnier2019-10-24 23:06:23 -0400
committerStefan Monnier2019-10-24 23:06:23 -0400
commitf131e396f8a32003b795456130ea37efa6ff41eb (patch)
treecceba834987ecea14bbbe8db5aa2877f2e6de13d /lisp/cedet/semantic
parent4a083b0d36a8b2afe23447dbc357de3641140d4d (diff)
downloademacs-f131e396f8a32003b795456130ea37efa6ff41eb.tar.gz
emacs-f131e396f8a32003b795456130ea37efa6ff41eb.zip
* lisp/cedet/mode-local.el: Clean up name space
Mostly renaming functions by adding `mode-local--` to their name and leaving an obsolete alias behind, just in case. (define-child-mode): Make obsolete. (mode-local--set-parent): Rename from set-mode-local-parent. (mode-local--new-bindings): Rename from new-mode-local-bindings. Use `obarray-make`. (mode-local--activate-bindings): Rename from activate-mode-local-bindings. (mode-local--deactivate-bindings): Rename from deactivate-mode-local-bindings. (make-obsolete-overload): Rename properties with a `mode-local--` prefix. Adjust all users. (mode-local--overload-obsoleted-by): Rename from overload-obsoleted-by. (mode-local--overload-that-obsolete): Rename from overload-that-obsolete. (mode-local--function-overload-p): Rename from function-overload-p. (mode-local-read-function): Mark obsolete. (mode-local--overload-docstring-extension): Rename from overload-docstring-extension. (mode-local--describe-overload): Rename from describe-mode-local-overload. * lisp/cedet/semantic/fw.el (semantic-install-function-overrides): Remove unused `mode` argument. * lisp/cedet/semantic/grammar-wy.el (semantic-grammar-wy--install-parser): * lisp/cedet/semantic/bovine/grammar.el (bovine-grammar-mode): * lisp/cedet/semantic/texi.el (semantic-default-texi-setup): * lisp/cedet/semantic/wisent/grammar.el (wisent-grammar-setupcode-builder) (wisent-grammar-mode): * lisp/cedet/semantic/html.el (semantic-default-html-setup): Make the `semantic-` prefix explicit to ease grep search. (html-helper-mode): Remove obsolete setting. * lisp/cedet/semantic/wisent/javascript.el: Fix js-mode/javascript-mode mixup so we don't need define-child-mode any more. (semantic-get-local-variables, semantic-ctxt-current-symbol) (semantic-tag-protection, semantic-analyze-scope-calculate-access): Use `js-mode` rather than `javascript-mode` as the mode name since that's the real mode's name. * lisp/cedet/semantic/wisent/python.el (python-2-mode, python-3-mode): Remove child declaration for non-existing modes. * lisp/cedet/srecode/map.el (srecode-map-validate-file-for-mode): Simplify.
Diffstat (limited to 'lisp/cedet/semantic')
-rw-r--r--lisp/cedet/semantic/bovine/c.el8
-rw-r--r--lisp/cedet/semantic/bovine/el.el9
-rw-r--r--lisp/cedet/semantic/bovine/grammar.el4
-rw-r--r--lisp/cedet/semantic/fw.el9
-rw-r--r--lisp/cedet/semantic/grammar-wy.el2
-rw-r--r--lisp/cedet/semantic/html.el8
-rw-r--r--lisp/cedet/semantic/lex-spp.el2
-rw-r--r--lisp/cedet/semantic/texi.el8
-rw-r--r--lisp/cedet/semantic/wisent/grammar.el6
-rw-r--r--lisp/cedet/semantic/wisent/javascript.el15
-rw-r--r--lisp/cedet/semantic/wisent/python.el5
11 files changed, 35 insertions, 41 deletions
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index b05082c60ef..862969dbc87 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -69,8 +69,10 @@ This function does not do any hidden buffer changes."
69 ) 69 )
70 70
71;;; Code: 71;;; Code:
72(define-child-mode c++-mode c-mode 72(with-suppressed-warnings ((obsolete define-child-mode))
73 "`c++-mode' uses the same parser as `c-mode'.") 73 ;; FIXME: We should handle this some other way!
74 (define-child-mode c++-mode c-mode
75 "`c++-mode' uses the same parser as `c-mode'."))
74 76
75 77
76;;; Include Paths 78;;; Include Paths
@@ -930,7 +932,7 @@ the regular parser."
930 ) ; save match data 932 ) ; save match data
931 933
932 ;; Hack in mode-local 934 ;; Hack in mode-local
933 (activate-mode-local-bindings) 935 (mode-local--activate-bindings)
934 ;; Setup C parser 936 ;; Setup C parser
935 (semantic-default-c-setup) 937 (semantic-default-c-setup)
936 ;; CHEATER! The following 3 lines are from 938 ;; CHEATER! The following 3 lines are from
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index dd21f50325e..590256cc709 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -496,7 +496,8 @@ used to perform the override."
496 (if (and (eq (semantic-tag-class tag) 'function) 496 (if (and (eq (semantic-tag-class tag) 'function)
497 (semantic-tag-get-attribute tag :overloadable)) 497 (semantic-tag-get-attribute tag :overloadable))
498 ;; Calc the doc to use for the overloadable symbols. 498 ;; Calc the doc to use for the overloadable symbols.
499 (overload-docstring-extension (intern (semantic-tag-name tag))) 499 (mode-local--overload-docstring-extension
500 (intern (semantic-tag-name tag)))
500 "")) 501 ""))
501 502
502(defun semantic-emacs-lisp-obsoleted-doc (tag) 503(defun semantic-emacs-lisp-obsoleted-doc (tag)
@@ -944,8 +945,10 @@ See `semantic-format-tag-prototype' for Emacs Lisp for more details."
944 "Add variables. 945 "Add variables.
945ELisp variables can be pretty long, so track this one too.") 946ELisp variables can be pretty long, so track this one too.")
946 947
947(define-child-mode lisp-mode emacs-lisp-mode 948(with-suppressed-warnings ((obsolete define-child-mode))
948 "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'.") 949 ;; FIXME: We should handle this some other way!
950 (define-child-mode lisp-mode emacs-lisp-mode
951 "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'."))
949 952
950;;;###autoload 953;;;###autoload
951(defun semantic-default-elisp-setup () 954(defun semantic-default-elisp-setup ()
diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el
index 7c25b79db86..4d7b008dbd3 100644
--- a/lisp/cedet/semantic/bovine/grammar.el
+++ b/lisp/cedet/semantic/bovine/grammar.el
@@ -438,8 +438,8 @@ Menu items are appended to the common grammar menu.")
438 "Major mode for editing Bovine grammars." 438 "Major mode for editing Bovine grammars."
439 (semantic-grammar-setup-menu bovine-grammar-menu) 439 (semantic-grammar-setup-menu bovine-grammar-menu)
440 (semantic-install-function-overrides 440 (semantic-install-function-overrides
441 '((grammar-parsetable-builder . bovine-grammar-parsetable-builder) 441 '((semantic-grammar-parsetable-builder . bovine-grammar-parsetable-builder)
442 (grammar-setupcode-builder . bovine-grammar-setupcode-builder)))) 442 (semantic-grammar-setupcode-builder . bovine-grammar-setupcode-builder))))
443 443
444(add-to-list 'auto-mode-alist '("\\.by\\'" . bovine-grammar-mode)) 444(add-to-list 'auto-mode-alist '("\\.by\\'" . bovine-grammar-mode))
445 445
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index e07f0901849..202dec3df3b 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -186,8 +186,8 @@ Mark OLDFNALIAS as obsolete, such that the byte compiler
186will throw a warning when it encounters this symbol." 186will throw a warning when it encounters this symbol."
187 (defalias oldfnalias newfn) 187 (defalias oldfnalias newfn)
188 (make-obsolete oldfnalias newfn when) 188 (make-obsolete oldfnalias newfn when)
189 (when (and (function-overload-p newfn) 189 (when (and (mode-local--function-overload-p newfn)
190 (not (overload-obsoleted-by newfn)) 190 (not (mode-local--overload-obsoleted-by newfn))
191 ;; Only throw this warning when byte compiling things. 191 ;; Only throw this warning when byte compiling things.
192 (boundp 'byte-compile-current-file) 192 (boundp 'byte-compile-current-file)
193 byte-compile-current-file 193 byte-compile-current-file
@@ -261,7 +261,7 @@ FUNCTION does not have arguments. When FUNCTION is entered
261(semantic-alias-obsolete 'define-mode-overload-implementation 261(semantic-alias-obsolete 'define-mode-overload-implementation
262 'define-mode-local-override "23.2") 262 'define-mode-local-override "23.2")
263 263
264(defun semantic-install-function-overrides (overrides &optional transient mode) 264(defun semantic-install-function-overrides (overrides &optional transient)
265 "Install the function OVERRIDES in the specified environment. 265 "Install the function OVERRIDES in the specified environment.
266OVERRIDES must be an alist ((OVERLOAD . FUNCTION) ...) where OVERLOAD 266OVERRIDES must be an alist ((OVERLOAD . FUNCTION) ...) where OVERLOAD
267is a symbol identifying an overloadable entry, and FUNCTION is the 267is a symbol identifying an overloadable entry, and FUNCTION is the
@@ -282,8 +282,7 @@ later installation should be done in MODE hook."
282 (cons (intern (format "semantic-%s" name)) (cdr e))))) 282 (cons (intern (format "semantic-%s" name)) (cdr e)))))
283 overrides) 283 overrides)
284 (list 'constant-flag (not transient) 284 (list 'constant-flag (not transient)
285 'override-flag t) 285 'override-flag t)))
286 mode))
287 286
288;;; User Interrupt handling 287;;; User Interrupt handling
289;; 288;;
diff --git a/lisp/cedet/semantic/grammar-wy.el b/lisp/cedet/semantic/grammar-wy.el
index 3b99469f558..1da57862d57 100644
--- a/lisp/cedet/semantic/grammar-wy.el
+++ b/lisp/cedet/semantic/grammar-wy.el
@@ -421,7 +421,7 @@
421(defun semantic-grammar-wy--install-parser () 421(defun semantic-grammar-wy--install-parser ()
422 "Setup the Semantic Parser." 422 "Setup the Semantic Parser."
423 (semantic-install-function-overrides 423 (semantic-install-function-overrides
424 '((parse-stream . wisent-parse-stream))) 424 '((semantic-parse-stream . wisent-parse-stream)))
425 (setq semantic-parser-name "LALR" 425 (setq semantic-parser-name "LALR"
426 semantic--parse-table semantic-grammar-wy--parse-table 426 semantic--parse-table semantic-grammar-wy--parse-table
427 semantic-debug-parser-source "grammar.wy" 427 semantic-debug-parser-source "grammar.wy"
diff --git a/lisp/cedet/semantic/html.el b/lisp/cedet/semantic/html.el
index 3a8165c423a..f70fec2db74 100644
--- a/lisp/cedet/semantic/html.el
+++ b/lisp/cedet/semantic/html.el
@@ -247,13 +247,15 @@ tag with greater section value than LEVEL is found."
247 semantic-stickyfunc-sticky-classes '(section) 247 semantic-stickyfunc-sticky-classes '(section)
248 ) 248 )
249 (semantic-install-function-overrides 249 (semantic-install-function-overrides
250 '((tag-components . semantic-html-components) 250 '((semantic-tag-components . semantic-html-components)
251 ) 251 )
252 t) 252 t)
253 ) 253 )
254 254
255(define-child-mode html-helper-mode html-mode 255;; `html-helper-mode' hasn't been updated since 2004, so it's not very
256 "`html-helper-mode' needs the same semantic support as `html-mode'.") 256;; relevant nowadays.
257;;(define-child-mode html-helper-mode html-mode
258;; "`html-helper-mode' needs the same semantic support as `html-mode'.")
257 259
258(provide 'semantic/html) 260(provide 'semantic/html)
259 261
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el
index d07dc806a48..a81b23ca750 100644
--- a/lisp/cedet/semantic/lex-spp.el
+++ b/lisp/cedet/semantic/lex-spp.el
@@ -1071,7 +1071,7 @@ and variable state from the current buffer."
1071 (error nil)) 1071 (error nil))
1072 1072
1073 ;; Hack in mode-local 1073 ;; Hack in mode-local
1074 (activate-mode-local-bindings) 1074 (mode-local--activate-bindings)
1075 1075
1076 ;; Call the major mode's setup function 1076 ;; Call the major mode's setup function
1077 (let ((entry (assq major-mode semantic-new-buffer-setup-functions))) 1077 (let ((entry (assq major-mode semantic-new-buffer-setup-functions)))
diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el
index 3a0050b920c..73f0e734f32 100644
--- a/lisp/cedet/semantic/texi.el
+++ b/lisp/cedet/semantic/texi.el
@@ -63,9 +63,9 @@ Each tag returned is of the form:
63or 63or
64 (\"NAME\" def) 64 (\"NAME\" def)
65 65
66It is an override of 'parse-region and must be installed by the 66It is an override of `semantic-parse-region' and must be installed by the
67function `semantic-install-function-overrides'." 67function `semantic-install-function-overrides'."
68 (mapcar 'semantic-texi-expand-tag 68 (mapcar #'semantic-texi-expand-tag
69 (semantic-texi-parse-headings))) 69 (semantic-texi-parse-headings)))
70 70
71(defun semantic-texi-parse-changes () 71(defun semantic-texi-parse-changes ()
@@ -451,8 +451,8 @@ that start with that symbol."
451 "Set up a buffer for parsing of Texinfo files." 451 "Set up a buffer for parsing of Texinfo files."
452 ;; This will use our parser. 452 ;; This will use our parser.
453 (semantic-install-function-overrides 453 (semantic-install-function-overrides
454 '((parse-region . semantic-texi-parse-region) 454 '((semantic-parse-region . semantic-texi-parse-region)
455 (parse-changes . semantic-texi-parse-changes))) 455 (semantic-parse-changes . semantic-texi-parse-changes)))
456 (setq semantic-parser-name "TEXI" 456 (setq semantic-parser-name "TEXI"
457 ;; Setup a dummy parser table to enable parsing! 457 ;; Setup a dummy parser table to enable parsing!
458 semantic--parse-table t 458 semantic--parse-table t
diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el
index e6b389b60ba..1254f996809 100644
--- a/lisp/cedet/semantic/wisent/grammar.el
+++ b/lisp/cedet/semantic/wisent/grammar.el
@@ -297,7 +297,7 @@ Return the expanded expression."
297 "Return the parser setup code." 297 "Return the parser setup code."
298 (format 298 (format
299 "(semantic-install-function-overrides\n\ 299 "(semantic-install-function-overrides\n\
300 '((parse-stream . wisent-parse-stream)))\n\ 300 '((semantic-parse-stream . wisent-parse-stream)))\n\
301 (setq semantic-parser-name \"LALR\"\n\ 301 (setq semantic-parser-name \"LALR\"\n\
302 semantic--parse-table %s\n\ 302 semantic--parse-table %s\n\
303 semantic-debug-parser-source %S\n\ 303 semantic-debug-parser-source %S\n\
@@ -326,8 +326,8 @@ Menu items are appended to the common grammar menu.")
326 "Major mode for editing Wisent grammars." 326 "Major mode for editing Wisent grammars."
327 (semantic-grammar-setup-menu wisent-grammar-menu) 327 (semantic-grammar-setup-menu wisent-grammar-menu)
328 (semantic-install-function-overrides 328 (semantic-install-function-overrides
329 '((grammar-parsetable-builder . wisent-grammar-parsetable-builder) 329 '((semantic-grammar-parsetable-builder . wisent-grammar-parsetable-builder)
330 (grammar-setupcode-builder . wisent-grammar-setupcode-builder)))) 330 (semantic-grammar-setupcode-builder . wisent-grammar-setupcode-builder))))
331 331
332(defvar-mode-local wisent-grammar-mode semantic-grammar-macros 332(defvar-mode-local wisent-grammar-mode semantic-grammar-macros
333 '( 333 '(
diff --git a/lisp/cedet/semantic/wisent/javascript.el b/lisp/cedet/semantic/wisent/javascript.el
index 7722c953609..4c93c0dc4fa 100644
--- a/lisp/cedet/semantic/wisent/javascript.el
+++ b/lisp/cedet/semantic/wisent/javascript.el
@@ -64,13 +64,13 @@ to this variable NAME."
64;; the tags created by the javascript parser. 64;; the tags created by the javascript parser.
65;; Local context 65;; Local context
66(define-mode-local-override semantic-get-local-variables 66(define-mode-local-override semantic-get-local-variables
67 javascript-mode () 67 js-mode ()
68 "Get local values from a specific context. 68 "Get local values from a specific context.
69This function overrides `get-local-variables'." 69This function overrides `get-local-variables'."
70 ;; Does javascript have identifiable local variables? 70 ;; Does javascript have identifiable local variables?
71 nil) 71 nil)
72 72
73(define-mode-local-override semantic-tag-protection javascript-mode (tag &optional parent) 73(define-mode-local-override semantic-tag-protection js-mode (tag &optional parent)
74 "Return protection information about TAG with optional PARENT. 74 "Return protection information about TAG with optional PARENT.
75This function returns on of the following symbols: 75This function returns on of the following symbols:
76 nil - No special protection. Language dependent. 76 nil - No special protection. Language dependent.
@@ -85,14 +85,14 @@ The default behavior (if not overridden with `tag-protection'
85is to return a symbol based on type modifiers." 85is to return a symbol based on type modifiers."
86 nil) 86 nil)
87 87
88(define-mode-local-override semantic-analyze-scope-calculate-access javascript-mode (type scope) 88(define-mode-local-override semantic-analyze-scope-calculate-access js-mode (type scope)
89 "Calculate the access class for TYPE as defined by the current SCOPE. 89 "Calculate the access class for TYPE as defined by the current SCOPE.
90Access is related to the :parents in SCOPE. If type is a member of SCOPE 90Access is related to the :parents in SCOPE. If type is a member of SCOPE
91then access would be 'private. If TYPE is inherited by a member of SCOPE, 91then access would be 'private. If TYPE is inherited by a member of SCOPE,
92the access would be 'protected. Otherwise, access is 'public." 92the access would be 'protected. Otherwise, access is 'public."
93 nil) 93 nil)
94 94
95(define-mode-local-override semantic-ctxt-current-symbol javascript-mode (&optional point) 95(define-mode-local-override semantic-ctxt-current-symbol js-mode (&optional point)
96 "Return the current symbol the cursor is on at POINT in a list. 96 "Return the current symbol the cursor is on at POINT in a list.
97This is a very simple implementation for Javascript symbols. It 97This is a very simple implementation for Javascript symbols. It
98will at maximum do one split, so that the first part is seen as 98will at maximum do one split, so that the first part is seen as
@@ -117,13 +117,6 @@ This is currently needed for the mozrepl omniscient database."
117 117
118;;; Setup Function 118;;; Setup Function
119;; 119;;
120;; Since javascript-mode is an alias for js-mode, let it inherit all
121;; the overrides.
122(define-child-mode js-mode javascript-mode)
123
124;; Since javascript-mode is an alias for js-mode, let it inherit all
125;; the overrides.
126(define-child-mode js-mode javascript-mode)
127 120
128;; In semantic-imenu.el, not part of Emacs. 121;; In semantic-imenu.el, not part of Emacs.
129(defvar semantic-imenu-summary-function) 122(defvar semantic-imenu-summary-function)
diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el
index f0e294efa62..540c59b9a7a 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -530,11 +530,6 @@ Shortens `code' tags, but passes through for others."
530 (code . "Code"))) 530 (code . "Code")))
531 ) 531 )
532 532
533;; Make sure the newer python modes pull in the same python
534;; mode overrides.
535(define-child-mode python-2-mode python-mode "Python 2 mode")
536(define-child-mode python-3-mode python-mode "Python 3 mode")
537
538 533
539;;; Utility functions 534;;; Utility functions
540;; 535;;