bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18306: 24.4.50; emacs 24.4.5 hangs in c-mode with '[' character


From: Alan Mackenzie
Subject: bug#18306: 24.4.50; emacs 24.4.5 hangs in c-mode with '[' character
Date: Sat, 23 Aug 2014 11:18:37 +0000 (UTC)
User-agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/8.4-RELEASE (amd64))

Hi, Nick.

nick <nick@wordtronix.org> wrote:
> While in c-mode writing the line: char s[]; emacs hangs without update.
> Obviously not happening in this bugreport mode. :/ .

Yes, there was an infinite loop down in the fontification code.  I think
it's fixed now.  Would you please try it out and confirm that it is
indeed fixed.  Either download and build the latest trunk, or apply this
patch:

diff -r 2cd4e65a2f5a cc-fonts.el
--- a/cc-fonts.el       Sat Aug 02 18:12:32 2014 +0000
+++ b/cc-fonts.el       Sat Aug 23 10:36:15 2014 +0000
@@ -1088,14 +1088,11 @@
            ;; initializing brace lists.
            (let (found)
              (while
-                 (and (setq found
-                            (c-syntactic-re-search-forward
-                             "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
-                      (eq (char-before) ?\[))
-               (backward-char)
-               (c-safe (c-forward-sexp 1))
-               (setq found nil)
-               (setq brackets-after-id t))
+                 (and (setq found (c-syntactic-re-search-forward
+                            "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
+                      (eq (char-before) ?\[)
+                      (c-go-up-list-forward))
+                    (setq brackets-after-id t))
              found))
 
       (setq next-pos (match-beginning 0)


Thanks for taking to trouble to report this bug.

-- 
Alan Mackenzie (Nuremberg, Germany).






reply via email to

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