emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 42daf83: CC Mode: Fix defun-open being recognized


From: Alan Mackenzie
Subject: [Emacs-diffs] emacs-26 42daf83: CC Mode: Fix defun-open being recognized as brace-list-open at EOB.
Date: Sun, 12 Nov 2017 06:53:25 -0500 (EST)

branch: emacs-26
commit 42daf83f08b2b0ef9d571e535195df55d392ef79
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    CC Mode: Fix defun-open being recognized as brace-list-open at EOB.
    
    * lisp/progmodes/cc-engine.el (c-looking-at-statement-block): Add handling
    for an open brace at EOB and nested braces inside an unclosed brace block.
---
 lisp/progmodes/cc-engine.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 8ec01e1..ab0204c 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -10740,10 +10740,8 @@ comment at the start of cc-engine.el for more info."
               (t                       ; We're at (1+ here).
                (cond
                 ((progn (c-forward-syntactic-ws)
-                        (eq (point) (1- there)))
-                 t)
-                ((c-syntactic-re-search-forward c-keywords-regexp there t)
-                 t)
+                        (eq (point) (1- there))))
+                ((c-syntactic-re-search-forward c-keywords-regexp there t))
                 ((c-syntactic-re-search-forward "{" there t t)
                  (backward-char)
                  (c-looking-at-statement-block))
@@ -10752,8 +10750,12 @@ comment at the start of cc-engine.el for more info."
          (cond
           ((c-syntactic-re-search-forward "[;,]" nil t t)
            (eq (char-before) ?\;))
-          ((c-syntactic-re-search-forward c-keywords-regexp nil t t)
-           t)
+          ((progn (c-forward-syntactic-ws)
+                  (eobp)))
+          ((c-syntactic-re-search-forward c-keywords-regexp nil t t))
+          ((c-syntactic-re-search-forward "{" nil t t)
+           (backward-char)
+           (c-looking-at-statement-block))
           (t nil)))
       (goto-char here))))
 



reply via email to

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