]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix absence of c-noise-macro-name-re, etc., in languages which don't use it
authorAlan Mackenzie <acm@muc.de>
Fri, 25 Mar 2016 18:25:08 +0000 (18:25 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 25 Mar 2016 18:25:08 +0000 (18:25 +0000)
* 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.

lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-mode.el
lisp/progmodes/cc-vars.el

index f9eae213ca8508e89f2d2473ee67b5ba4226d658..e04929a7226976c6c25b18f876f34d4a2c519e49 100644 (file)
@@ -5838,7 +5838,8 @@ comment at the start of cc-engine.el for more info."
                nil
              (cond ((looking-at c-keywords-regexp)
                     (c-forward-keyword-clause 1))
-                   ((looking-at c-noise-macro-with-parens-name-re)
+                   ((and c-opt-cpp-prefix
+                         (looking-at c-noise-macro-with-parens-name-re))
                     (c-forward-noise-clause)))))
      (when (memq res '(t known found prefix))
        ,(when (eq type 'ref)
@@ -6506,7 +6507,8 @@ comment at the start of cc-engine.el for more info."
       (while (cond
              ((looking-at c-decl-hangon-key)
               (c-forward-keyword-clause 1))
-             ((looking-at c-noise-macro-with-parens-name-re)
+             ((and c-opt-cpp-prefix
+                   (looking-at c-noise-macro-with-parens-name-re))
               (c-forward-noise-clause))))
 
       (setq pos (point))
@@ -6911,7 +6913,8 @@ comment at the start of cc-engine.el for more info."
                  (cond
                   ((looking-at c-decl-hangon-key)
                    (c-forward-keyword-clause 1))
-                  ((looking-at c-noise-macro-with-parens-name-re)
+                  ((and c-opt-cpp-prefix
+                        (looking-at c-noise-macro-with-parens-name-re))
                    (c-forward-noise-clause))
                   ((and (looking-at c-type-decl-prefix-key)
                         (if (and (c-major-mode-is 'c++-mode)
@@ -6966,7 +6969,8 @@ comment at the start of cc-engine.el for more info."
              (while (cond
                      ((looking-at c-decl-hangon-key)
                       (c-forward-keyword-clause 1))
-                     ((looking-at c-noise-macro-with-parens-name-re)
+                     ((and c-opt-cpp-prefix
+                           (looking-at c-noise-macro-with-parens-name-re))
                       (c-forward-noise-clause))))
              (<= (point) limit))
 
@@ -7161,7 +7165,8 @@ comment at the start of cc-engine.el for more info."
            (save-excursion
              (c-forward-keyword-clause 1)
              (setq kwd-clause-end (point))))
-          ((looking-at c-noise-macro-with-parens-name-re)
+          ((and c-opt-cpp-prefix
+                (looking-at c-noise-macro-with-parens-name-re))
            (setq noise-start (point))
            (c-forward-noise-clause)
            (setq kwd-clause-end (point))))
@@ -7267,7 +7272,8 @@ comment at the start of cc-engine.el for more info."
       (while
          (cond ((looking-at c-decl-hangon-key)
                 (c-forward-keyword-clause 1))
-               ((looking-at c-noise-macro-with-parens-name-re)
+               ((and c-opt-cpp-prefix
+                     (looking-at c-noise-macro-with-parens-name-re))
                 (c-forward-noise-clause))))
       (setq id-start (point)))
 
@@ -9038,7 +9044,8 @@ comment at the start of cc-engine.el for more info."
          ((eq (char-after) ?\()
           (and (eq (c-backward-token-2) 0)
                (or (looking-at c-decl-hangon-key)
-                   (looking-at c-noise-macro-with-parens-name-re))))
+                   (and c-opt-cpp-prefix
+                        (looking-at c-noise-macro-with-parens-name-re)))))
 
          ((and c-recognize-<>-arglists
                (eq (char-after) ?<)
@@ -10303,7 +10310,8 @@ comment at the start of cc-engine.el for more info."
              (while (cond
                      ((looking-at c-specifier-key)
                       (c-forward-keyword-clause 1))
-                     ((looking-at c-noise-macro-with-parens-name-re)
+                     ((and c-opt-cpp-prefix
+                           (looking-at c-noise-macro-with-parens-name-re))
                       (c-forward-noise-clause))))
              (setq placeholder (c-point 'boi))
              (or (consp special-brace-list)
@@ -10359,7 +10367,8 @@ comment at the start of cc-engine.el for more info."
              (while (cond
                      ((looking-at c-specifier-key)
                       (c-forward-keyword-clause 1))
-                     ((looking-at c-noise-macro-with-parens-name-re)
+                     ((and c-opt-cpp-prefix
+                           (looking-at c-noise-macro-with-parens-name-re))
                       (c-forward-noise-clause))))
              (c-add-syntax 'defun-open (c-point 'boi))
              ;; 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."
            (while (cond
                    ((looking-at c-specifier-key)
                     (c-forward-keyword-clause 1))
-                   ((looking-at c-noise-macro-with-parens-name-re)
+                   ((and c-opt-cpp-prefix
+                         (looking-at c-noise-macro-with-parens-name-re))
                     (c-forward-noise-clause))))
            (c-add-syntax 'brace-list-open (c-point 'boi))))
 
index a7097b98c9d29328508cdab7b8136bebacaae3e3..67e88a34bf92d64ceba43b7435350e0fe3f02f23 100644 (file)
@@ -1705,7 +1705,9 @@ on level 2 only and so aren't combined with `c-complex-decl-matchers'."
                                              (looking-at "@[A-Za-z0-9]+")))
                                 (c-forward-keyword-clause 1)
                                 t)
-                              (when (looking-at c-noise-macro-with-parens-name-re)
+                              (when (and c-opt-cpp-prefix
+                                         (looking-at
+                                          c-noise-macro-with-parens-name-re))
                                 (c-forward-noise-clause)
                                 t)))
                          ,(if (c-major-mode-is 'c++-mode)
index 9ebe6f79eb3f49aaf7c10332341e0340852245f6..a53c86c342cbe7c758a0e49f3a7b2981b2de29c1 100644 (file)
@@ -596,6 +596,7 @@ that requires a literal mode spec at compile time."
                                     (not (string-equal c-indentation-style
                                                        style)))))))
   (c-setup-paragraph-variables)
+  (c-make-noise-macro-regexps)
 
   ;; we have to do something special for c-offsets-alist so that the
   ;; buffer local value has its own alist structure.
@@ -1493,7 +1494,6 @@ Key bindings:
        abbrev-mode t)
   (use-local-map c-mode-map)
   (c-init-language-vars-for 'c-mode)
-  (c-make-noise-macro-regexps)
   (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
   (c-common-init 'c-mode)
   (easy-menu-add c-c-menu)
@@ -1549,7 +1549,6 @@ Key bindings:
        abbrev-mode t)
   (use-local-map c++-mode-map)
   (c-init-language-vars-for 'c++-mode)
-  (c-make-noise-macro-regexps)
   (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
   (c-common-init 'c++-mode)
   (easy-menu-add c-c++-menu)
@@ -1603,7 +1602,6 @@ Key bindings:
        abbrev-mode t)
   (use-local-map objc-mode-map)
   (c-init-language-vars-for 'objc-mode)
-  (c-make-noise-macro-regexps)
   (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
   (c-common-init 'objc-mode)
   (easy-menu-add c-objc-menu)
index a6957185a2b273ae28c564ecc31249470e4ebcfc..33ea152c89a0d4c9f581d1e631a099d23cad37a5 100644 (file)
@@ -1619,8 +1619,8 @@ names)."))
   :type 'c-extra-types-widget
   :group 'c)
 
-(defvar c-noise-macro-with-parens-name-re nil)
-(defvar c-noise-macro-name-re nil)
+(defvar c-noise-macro-with-parens-name-re "\\<\\>")
+(defvar c-noise-macro-name-re "\\<\\>")
 
 (defcustom c-noise-macro-names nil
   "A list of names of macros which expand to nothing, or compiler extensions