[Top][All Lists]

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

bug#37137: Setting font-lock-case-fold-search to t causes hangs on certa

From: Zachary Napier
Subject: bug#37137: Setting font-lock-case-fold-search to t causes hangs on certain types in c-mode
Date: Wed, 21 Aug 2019 15:20:20 -0700

I have in my .emacs file only these two lines:

     '(font-lock-keywords-case-fold-search t))

Then if I visit an empty or nonexistent C file and just type "LONG"
(in all caps or with at least one letter being capital), Emacs will
hang after typing the final G but before the G appears on
screen. Typing C-g a couple of times gets Emacs unstuck until I
continue to type. The same behavior also happens if I type "SHORT".

This happens in both Emacs 26.1 in text mode on a Linux machine and in
Emacs 25.3 in GUI mode on Windows.

After messing with GDB a bit, I am pretty sure the hang is at the
while loop in c-forward-type at cc-engine.el:7657 and its getting
stuck because looking-at matches LONG because its case insensitive,
but the c-forward-keyword-clause doesn't move forward because the
first thing it does is try to find "LONG" in c-keywords-obarray via
`intern-soft` and immediately returns because it doesn't find it
there. Here is the while loop:

    (while (progn
             (setq safe-pos (point))
             (looking-at c-opt-type-component-key))
      (when (and c-record-type-identifiers
                 (looking-at c-primitive-type-key))
        (c-record-type-id (cons (match-beginning 1)
                                (match-end 1))))
      (c-forward-keyword-clause 1))

reply via email to

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