emacs-diffs
[Top][All Lists]
Advanced

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

master 78923c5f4e: C++ Mode - Fontify "class Foo {\n ~Foo() noexcept; "


From: Alan Mackenzie
Subject: master 78923c5f4e: C++ Mode - Fontify "class Foo {\n ~Foo() noexcept; " correctly
Date: Wed, 24 Aug 2022 15:30:26 -0400 (EDT)

branch: master
commit 78923c5f4e26d3cb9fbaf0dbf2d04c523482e52c
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    C++ Mode - Fontify "class Foo {\n  ~Foo() noexcept;" correctly
    
    This fixes bug #49787.
    
    * lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): (In `if' form just
    before CASE 8) Remove the (not ...) around the (looking-at
    c-after-suffixed-type-maybe-decl-key).
    
    * lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Add
    `c-not-decl' to the values of c-type which are erased at the start of a
    fontification.
---
 lisp/progmodes/cc-engine.el | 4 ++--
 lisp/progmodes/cc-fonts.el  | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index f46c909fea..1139423a45 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -10571,8 +10571,8 @@ This function might do hidden buffer changes."
                        backup-maybe-typeless
                        (when c-recognize-typeless-decls
                          (or (not got-suffix)
-                             (not (looking-at
-                                   c-after-suffixed-type-maybe-decl-key))))))
+                             (looking-at
+                              c-after-suffixed-type-maybe-decl-key)))))
               ;; Got an empty paren pair and a preceding type that probably
               ;; really is the identifier.  Shift the type backwards to make
               ;; the last one the identifier.  This is analogous to the
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 2495d21a10..12bb3d3751 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -940,7 +940,8 @@ casts and declarations are fontified.  Used on level 2 and 
higher."
                        '(c-decl-arg-start
                          c-decl-end
                          c-decl-id-start
-                         c-decl-type-start)))
+                         c-decl-type-start
+                         c-not-decl)))
             (1- (point))
           pos)
         limit 'c-type)))



reply via email to

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