emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 201f950: Correct the fontification of C++ Mode encl


From: Alan Mackenzie
Subject: [Emacs-diffs] master 201f950: Correct the fontification of C++ Mode enclosed declarations.
Date: Thu, 31 Aug 2017 14:13:46 -0400 (EDT)

branch: master
commit 201f950e665153733b47b133a839921bc95806e3
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    Correct the fontification of C++ Mode enclosed declarations.
    
    * lisp/progmodes/cc-fonts.el (c-font-lock-enclosing-decls): abolish the
    spurious check that the character before the start of an enclosed 
declaration
    must be ; or }.  It might also be {.
---
 lisp/progmodes/cc-fonts.el | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index b35d33a..95246f9 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1710,18 +1710,16 @@ casts and declarations are fontified.  Used on level 2 
and higher."
                 (eq (char-after ps-elt) ?\{))
        (goto-char ps-elt)
        (c-syntactic-skip-backward "^;{}" decl-search-lim)
-       (when (or (bobp)
-                 (memq (char-before) '(?\; ?})))
-         (c-forward-syntactic-ws)
-         (setq in-typedef (looking-at c-typedef-key))
-         (if in-typedef (c-forward-token-2))
-         (when (and c-opt-block-decls-with-vars-key
-                    (looking-at c-opt-block-decls-with-vars-key))
-           (goto-char ps-elt)
-           (when (c-safe (c-forward-sexp))
-             (c-forward-syntactic-ws)
-             (c-font-lock-declarators limit t in-typedef
-                                      (not (c-bs-at-toplevel-p 
(point)))))))))))
+       (c-forward-syntactic-ws)
+       (setq in-typedef (looking-at c-typedef-key))
+       (if in-typedef (c-forward-token-2))
+       (when (and c-opt-block-decls-with-vars-key
+                  (looking-at c-opt-block-decls-with-vars-key))
+         (goto-char ps-elt)
+         (when (c-safe (c-forward-sexp))
+           (c-forward-syntactic-ws)
+           (c-font-lock-declarators limit t in-typedef
+                                    (not (c-bs-at-toplevel-p (point))))))))))
 
 (defun c-font-lock-raw-strings (limit)
   ;; Fontify C++ raw strings.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]