summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-vars.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2019-02-17 18:57:10 +0000
committerAlan Mackenzie <acm@muc.de>2019-02-17 18:57:10 +0000
commitadeea448bcbf12b8f6f33af0ddc9867fa49f5b4a (patch)
tree336d1cf816e3f414055879fa43b6a035a5b5a440 /lisp/progmodes/cc-vars.el
parent7898568bbb62acc6e6c44513a06ddf2b7b656c22 (diff)
downloademacs-adeea448bcbf12b8f6f33af0ddc9867fa49f5b4a.tar.gz
Fontify C function identifiers in parentheses correctly (e.g. in lisp.h)
Fix handling of CC Mode's syntactic WS cache. Make noise-macro option variables buffer local. * lisp/progmodes/cc-engine.el (c-put-is-sws, c-put-in-sws, c-remove-is-sws) (c-remove-in-sws c-remove-is-and-in-sws): Add edebug specs. (c-invalidate-sws-region-before): Add a `beg' parameter. Handle noise macros like other literals. (c-invalidate-sws-region-after-del): Move the adjustment of (cdr c-sws-lit-limits) due to buffer change to c-invalidate-sws-region-after. (c-invalidate-sws-region-after-ins): Move (goto-char end) to the correct place. (c-invalidate-sws-region-after): Adjust (cdr c-sws-lit-limits) due to buffer change. Handle noise macros. (c-backward-sws): Set simple-ws-beg appropriately when the start point is in the middle of a noise macro. (c-forward-decl-or-cast-1): Recognize a function identifier being declared in parentheses. * lisp/promodes/cc-mode.el (c-before-change): Supply a `beg' argument to c-invalidate-sws-region-before. * lisp/progmodes/cc-vars.el (c-noise-macro-with-parens-name-re) (c-noise-macro-name-re, c-noise-macro-names, c-noise-macro-with-parens-names): Make these buffer local variables.
Diffstat (limited to 'lisp/progmodes/cc-vars.el')
-rw-r--r--lisp/progmodes/cc-vars.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 66960b630e1..89534882672 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1649,7 +1649,9 @@ white space either before or after the operator, but not both."
;; Initialize the next two to a regexp which never matches.
(defvar c-noise-macro-with-parens-name-re "a\\`")
+(make-variable-buffer-local 'c-noise-macro-with-parens-name-re)
(defvar c-noise-macro-name-re "a\\`")
+(make-variable-buffer-local 'c-noise-macro-name-re)
(defcustom c-noise-macro-names nil
"A list of names of macros which expand to nothing, or compiler extensions
@@ -1664,6 +1666,7 @@ this implicitly by reinitializing C/C++/Objc Mode on any buffer)."
:type '(repeat :tag "List of names" string)
:group 'c)
(put 'c-noise-macro-names 'safe-local-variable #'c-string-list-p)
+(make-variable-buffer-local 'c-noise-macro-names)
(defcustom c-noise-macro-with-parens-names nil
"A list of names of macros \(or compiler extensions like \"__attribute__\")
@@ -1673,6 +1676,7 @@ These are recognized by CC Mode only in declarations."
:type '(repeat :tag "List of names (possibly empty)" string)
:group 'c)
(put 'c-noise-macro-with-parens-names 'safe-local-variable #'c-string-list-p)
+(make-variable-buffer-local 'c-noise-macro-with-parens-names)
(defun c-make-noise-macro-regexps ()
;; Convert `c-noise-macro-names' and `c-noise-macro-with-parens-names' into