aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2016-03-25 18:25:08 +0000
committerAlan Mackenzie2016-03-25 18:25:08 +0000
commit368b9bb45f125061506d43af4bd4791ab2cfd7b9 (patch)
tree1c1d8b1e6368aaea6509fd274d0c8f2929743cd1
parent7570b35740915626e94c6038e3203374ce4267b1 (diff)
downloademacs-368b9bb45f125061506d43af4bd4791ab2cfd7b9.tar.gz
emacs-368b9bb45f125061506d43af4bd4791ab2cfd7b9.zip
Fix absence of c-noise-macro-name-re, etc., in languages which don't use it
* lisp/progmodes/cc-engine.el (c-forward-keyword-prefixed-id, c-forward-type) (c-forward-declarator, c-forward-decl-or-cast-1, c-backward-over-enum-header) (c-guess-basic-syntax): Check c-opt-cpp-prefix before `looking-at' c-noise-macro-with-parens-name-re. * lisp/progmodes/cc-fonts.el (c-complex-decl-matchers): The same as for cc-engine.el. * lisp/progmodes/cc-mode.el (c-basic-common-init): Add call to `c-make-noise-macro-regexps'. (c-mode, c++-mode, objc-mode): Remove calls to `c-make-noise-macro-regexps'. * lisp/progmodes/cc-vars.el (c-noise-macro-with-parens-name-re) (c-noise-macro-with-re): Initialize to "\\<\\>" rather than nil.
-rw-r--r--lisp/progmodes/cc-engine.el30
-rw-r--r--lisp/progmodes/cc-fonts.el4
-rw-r--r--lisp/progmodes/cc-mode.el4
-rw-r--r--lisp/progmodes/cc-vars.el4
4 files changed, 26 insertions, 16 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index f9eae213ca8..e04929a7226 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -5838,7 +5838,8 @@ comment at the start of cc-engine.el for more info."
5838 nil 5838 nil
5839 (cond ((looking-at c-keywords-regexp) 5839 (cond ((looking-at c-keywords-regexp)
5840 (c-forward-keyword-clause 1)) 5840 (c-forward-keyword-clause 1))
5841 ((looking-at c-noise-macro-with-parens-name-re) 5841 ((and c-opt-cpp-prefix
5842 (looking-at c-noise-macro-with-parens-name-re))
5842 (c-forward-noise-clause))))) 5843 (c-forward-noise-clause)))))
5843 (when (memq res '(t known found prefix)) 5844 (when (memq res '(t known found prefix))
5844 ,(when (eq type 'ref) 5845 ,(when (eq type 'ref)
@@ -6506,7 +6507,8 @@ comment at the start of cc-engine.el for more info."
6506 (while (cond 6507 (while (cond
6507 ((looking-at c-decl-hangon-key) 6508 ((looking-at c-decl-hangon-key)
6508 (c-forward-keyword-clause 1)) 6509 (c-forward-keyword-clause 1))
6509 ((looking-at c-noise-macro-with-parens-name-re) 6510 ((and c-opt-cpp-prefix
6511 (looking-at c-noise-macro-with-parens-name-re))
6510 (c-forward-noise-clause)))) 6512 (c-forward-noise-clause))))
6511 6513
6512 (setq pos (point)) 6514 (setq pos (point))
@@ -6911,7 +6913,8 @@ comment at the start of cc-engine.el for more info."
6911 (cond 6913 (cond
6912 ((looking-at c-decl-hangon-key) 6914 ((looking-at c-decl-hangon-key)
6913 (c-forward-keyword-clause 1)) 6915 (c-forward-keyword-clause 1))
6914 ((looking-at c-noise-macro-with-parens-name-re) 6916 ((and c-opt-cpp-prefix
6917 (looking-at c-noise-macro-with-parens-name-re))
6915 (c-forward-noise-clause)) 6918 (c-forward-noise-clause))
6916 ((and (looking-at c-type-decl-prefix-key) 6919 ((and (looking-at c-type-decl-prefix-key)
6917 (if (and (c-major-mode-is 'c++-mode) 6920 (if (and (c-major-mode-is 'c++-mode)
@@ -6966,7 +6969,8 @@ comment at the start of cc-engine.el for more info."
6966 (while (cond 6969 (while (cond
6967 ((looking-at c-decl-hangon-key) 6970 ((looking-at c-decl-hangon-key)
6968 (c-forward-keyword-clause 1)) 6971 (c-forward-keyword-clause 1))
6969 ((looking-at c-noise-macro-with-parens-name-re) 6972 ((and c-opt-cpp-prefix
6973 (looking-at c-noise-macro-with-parens-name-re))
6970 (c-forward-noise-clause)))) 6974 (c-forward-noise-clause))))
6971 (<= (point) limit)) 6975 (<= (point) limit))
6972 6976
@@ -7161,7 +7165,8 @@ comment at the start of cc-engine.el for more info."
7161 (save-excursion 7165 (save-excursion
7162 (c-forward-keyword-clause 1) 7166 (c-forward-keyword-clause 1)
7163 (setq kwd-clause-end (point)))) 7167 (setq kwd-clause-end (point))))
7164 ((looking-at c-noise-macro-with-parens-name-re) 7168 ((and c-opt-cpp-prefix
7169 (looking-at c-noise-macro-with-parens-name-re))
7165 (setq noise-start (point)) 7170 (setq noise-start (point))
7166 (c-forward-noise-clause) 7171 (c-forward-noise-clause)
7167 (setq kwd-clause-end (point)))) 7172 (setq kwd-clause-end (point))))
@@ -7267,7 +7272,8 @@ comment at the start of cc-engine.el for more info."
7267 (while 7272 (while
7268 (cond ((looking-at c-decl-hangon-key) 7273 (cond ((looking-at c-decl-hangon-key)
7269 (c-forward-keyword-clause 1)) 7274 (c-forward-keyword-clause 1))
7270 ((looking-at c-noise-macro-with-parens-name-re) 7275 ((and c-opt-cpp-prefix
7276 (looking-at c-noise-macro-with-parens-name-re))
7271 (c-forward-noise-clause)))) 7277 (c-forward-noise-clause))))
7272 (setq id-start (point))) 7278 (setq id-start (point)))
7273 7279
@@ -9038,7 +9044,8 @@ comment at the start of cc-engine.el for more info."
9038 ((eq (char-after) ?\() 9044 ((eq (char-after) ?\()
9039 (and (eq (c-backward-token-2) 0) 9045 (and (eq (c-backward-token-2) 0)
9040 (or (looking-at c-decl-hangon-key) 9046 (or (looking-at c-decl-hangon-key)
9041 (looking-at c-noise-macro-with-parens-name-re)))) 9047 (and c-opt-cpp-prefix
9048 (looking-at c-noise-macro-with-parens-name-re)))))
9042 9049
9043 ((and c-recognize-<>-arglists 9050 ((and c-recognize-<>-arglists
9044 (eq (char-after) ?<) 9051 (eq (char-after) ?<)
@@ -10303,7 +10310,8 @@ comment at the start of cc-engine.el for more info."
10303 (while (cond 10310 (while (cond
10304 ((looking-at c-specifier-key) 10311 ((looking-at c-specifier-key)
10305 (c-forward-keyword-clause 1)) 10312 (c-forward-keyword-clause 1))
10306 ((looking-at c-noise-macro-with-parens-name-re) 10313 ((and c-opt-cpp-prefix
10314 (looking-at c-noise-macro-with-parens-name-re))
10307 (c-forward-noise-clause)))) 10315 (c-forward-noise-clause))))
10308 (setq placeholder (c-point 'boi)) 10316 (setq placeholder (c-point 'boi))
10309 (or (consp special-brace-list) 10317 (or (consp special-brace-list)
@@ -10359,7 +10367,8 @@ comment at the start of cc-engine.el for more info."
10359 (while (cond 10367 (while (cond
10360 ((looking-at c-specifier-key) 10368 ((looking-at c-specifier-key)
10361 (c-forward-keyword-clause 1)) 10369 (c-forward-keyword-clause 1))
10362 ((looking-at c-noise-macro-with-parens-name-re) 10370 ((and c-opt-cpp-prefix
10371 (looking-at c-noise-macro-with-parens-name-re))
10363 (c-forward-noise-clause)))) 10372 (c-forward-noise-clause))))
10364 (c-add-syntax 'defun-open (c-point 'boi)) 10373 (c-add-syntax 'defun-open (c-point 'boi))
10365 ;; Bogus to use bol here, but it's the legacy. (Resolved, 10374 ;; Bogus to use bol here, but it's the legacy. (Resolved,
@@ -10994,7 +11003,8 @@ comment at the start of cc-engine.el for more info."
10994 (while (cond 11003 (while (cond
10995 ((looking-at c-specifier-key) 11004 ((looking-at c-specifier-key)
10996 (c-forward-keyword-clause 1)) 11005 (c-forward-keyword-clause 1))
10997 ((looking-at c-noise-macro-with-parens-name-re) 11006 ((and c-opt-cpp-prefix
11007 (looking-at c-noise-macro-with-parens-name-re))
10998 (c-forward-noise-clause)))) 11008 (c-forward-noise-clause))))
10999 (c-add-syntax 'brace-list-open (c-point 'boi)))) 11009 (c-add-syntax 'brace-list-open (c-point 'boi))))
11000 11010
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index a7097b98c9d..67e88a34bf9 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1705,7 +1705,9 @@ on level 2 only and so aren't combined with `c-complex-decl-matchers'."
1705 (looking-at "@[A-Za-z0-9]+"))) 1705 (looking-at "@[A-Za-z0-9]+")))
1706 (c-forward-keyword-clause 1) 1706 (c-forward-keyword-clause 1)
1707 t) 1707 t)
1708 (when (looking-at c-noise-macro-with-parens-name-re) 1708 (when (and c-opt-cpp-prefix
1709 (looking-at
1710 c-noise-macro-with-parens-name-re))
1709 (c-forward-noise-clause) 1711 (c-forward-noise-clause)
1710 t))) 1712 t)))
1711 ,(if (c-major-mode-is 'c++-mode) 1713 ,(if (c-major-mode-is 'c++-mode)
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 9ebe6f79eb3..a53c86c342c 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -596,6 +596,7 @@ that requires a literal mode spec at compile time."
596 (not (string-equal c-indentation-style 596 (not (string-equal c-indentation-style
597 style))))))) 597 style)))))))
598 (c-setup-paragraph-variables) 598 (c-setup-paragraph-variables)
599 (c-make-noise-macro-regexps)
599 600
600 ;; we have to do something special for c-offsets-alist so that the 601 ;; we have to do something special for c-offsets-alist so that the
601 ;; buffer local value has its own alist structure. 602 ;; buffer local value has its own alist structure.
@@ -1493,7 +1494,6 @@ Key bindings:
1493 abbrev-mode t) 1494 abbrev-mode t)
1494 (use-local-map c-mode-map) 1495 (use-local-map c-mode-map)
1495 (c-init-language-vars-for 'c-mode) 1496 (c-init-language-vars-for 'c-mode)
1496 (c-make-noise-macro-regexps)
1497 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; 1497 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
1498 (c-common-init 'c-mode) 1498 (c-common-init 'c-mode)
1499 (easy-menu-add c-c-menu) 1499 (easy-menu-add c-c-menu)
@@ -1549,7 +1549,6 @@ Key bindings:
1549 abbrev-mode t) 1549 abbrev-mode t)
1550 (use-local-map c++-mode-map) 1550 (use-local-map c++-mode-map)
1551 (c-init-language-vars-for 'c++-mode) 1551 (c-init-language-vars-for 'c++-mode)
1552 (c-make-noise-macro-regexps)
1553 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; 1552 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
1554 (c-common-init 'c++-mode) 1553 (c-common-init 'c++-mode)
1555 (easy-menu-add c-c++-menu) 1554 (easy-menu-add c-c++-menu)
@@ -1603,7 +1602,6 @@ Key bindings:
1603 abbrev-mode t) 1602 abbrev-mode t)
1604 (use-local-map objc-mode-map) 1603 (use-local-map objc-mode-map)
1605 (c-init-language-vars-for 'objc-mode) 1604 (c-init-language-vars-for 'objc-mode)
1606 (c-make-noise-macro-regexps)
1607 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; 1605 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
1608 (c-common-init 'objc-mode) 1606 (c-common-init 'objc-mode)
1609 (easy-menu-add c-objc-menu) 1607 (easy-menu-add c-objc-menu)
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index a6957185a2b..33ea152c89a 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1619,8 +1619,8 @@ names)."))
1619 :type 'c-extra-types-widget 1619 :type 'c-extra-types-widget
1620 :group 'c) 1620 :group 'c)
1621 1621
1622(defvar c-noise-macro-with-parens-name-re nil) 1622(defvar c-noise-macro-with-parens-name-re "\\<\\>")
1623(defvar c-noise-macro-name-re nil) 1623(defvar c-noise-macro-name-re "\\<\\>")
1624 1624
1625(defcustom c-noise-macro-names nil 1625(defcustom c-noise-macro-names nil
1626 "A list of names of macros which expand to nothing, or compiler extensions 1626 "A list of names of macros which expand to nothing, or compiler extensions