emacs-diffs
[Top][All Lists]
Advanced

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

emacs-28 06545bc0cc: CC Mode: c-update-brace-stack: After struct foo *,


From: Alan Mackenzie
Subject: emacs-28 06545bc0cc: CC Mode: c-update-brace-stack: After struct foo *, do not expect a brace.
Date: Wed, 29 Dec 2021 14:07:34 -0500 (EST)

branch: emacs-28
commit 06545bc0cc533b1abd831dd521df5f3369675d61
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    CC Mode: c-update-brace-stack: After struct foo *, do not expect a brace.
    
    This fixes bug #52796.
    
    * lisp/progmodes/cc-engine.el (c-update-brace-stack): Handle a "*" like a
    semicolon, cancelling the expectation of a brace.
    
    * lisp/progmodes/cc-langs.el (c-brace-stack-thing-key): Add a "*" into the
    sets of significant characters.
---
 lisp/progmodes/cc-engine.el | 2 +-
 lisp/progmodes/cc-langs.el  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index db1f46621d..862652e2e5 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -6135,7 +6135,7 @@ comment at the start of cc-engine.el for more info."
          (setq s (cons -1 (cdr s))))
         ((and (equal match ",")
               (eq (car s) -1)))        ; at "," in "class foo : bar, ..."
-        ((member match '(";" "," ")"))
+        ((member match '(";" "*" "," "("))
          (when (and s (cdr s) (<= (car s) 0))
            (setq s (cdr s))))
         ((c-keyword-member kwd-sym 'c-flat-decl-block-kwds)
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 53f6206a82..85cc887110 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -3180,8 +3180,8 @@ Note that Java specific rules are currently applied to 
tell this from
       (append
        (c-lang-const c-flat-decl-block-kwds)
        (if (c-lang-const c-recognize-<>-arglists)
-          '("{" "}" ";" "," ")" ":" "<")
-        '("{" "}" ";" "," ")" ":")))))
+          '("{" "}" ";" "*" "," ")" ":" "<")
+        '("{" "}" ";" "*" "," ")" ":")))))
 (c-lang-defvar c-brace-stack-thing-key (c-lang-const c-brace-stack-thing-key))
 
 (c-lang-defconst c-brace-stack-no-semi-key



reply via email to

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