emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 9877c03: Fix bug #33416, where typing a ) in a co


From: Alan Mackenzie
Subject: [Emacs-diffs] emacs-26 9877c03: Fix bug #33416, where typing a ) in a comment at EOB caused a loop (CC Mode).
Date: Sat, 24 Nov 2018 05:37:38 -0500 (EST)

branch: emacs-26
commit 9877c03293241091ba4069002d4dc4d74b557414
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    Fix bug #33416, where typing a ) in a comment at EOB caused a loop (CC 
Mode).
    
    * lisp/progmodes/cc-mode.el (c-fl-decl-start): A c-forward-syntactic-ws 
leaves
    point inside whitespace when moving over a comment at EOB which has no
    terminating LF.  Check this possibility and correct for it.
---
 lisp/progmodes/cc-mode.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 664f010..424cde5 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1512,7 +1512,10 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
         (c-syntactic-skip-backward "^;{}" bod-lim t)
         (> (point) bod-lim)
         (progn (c-forward-syntactic-ws)
-               (setq bo-decl (point))
+               ;; Have we got stuck in a comment at EOB?
+               (not (and (eobp)
+                         (c-literal-start))))
+        (progn (setq bo-decl (point))
                (or (not (looking-at c-protection-key))
                    (c-forward-keyword-clause 1)))
         (progn



reply via email to

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