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

[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: Alan Mackenzie
Subject: bug#37137: Setting font-lock-case-fold-search to t causes hangs on certain types in c-mode
Date: Mon, 2 Sep 2019 19:26:26 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Stefan and Zachary.

On Mon, Sep 02, 2019 at 08:50:12 -0400, Stefan Monnier wrote:
> > I inherited this .emacs file from someone else who had this
> > set.  I'm guessing it used to be customizable?

> AFAICT it's never been custom-izable, and it really would be weird for
> it to be.  I think it's more likely that this custom-set-variables was
> hand-edited.

That variable couldn't possibly have been customisable.  It's default
value being other than nil breaks font locking, in that it spikes its
active binding to t, regardless of the value supplied in (nth 2
font-lock-defaults).

> > I can just change the regexps I am using in
> > font-lock-add-keywords.

> That's a much safer approach.  You can also do

>     (add-hook '<foo>-mode-hook
>       (lambda ()
>         (setq-local font-lock-case-fold-search t)))

> for the specific mode where you need it: it may break the font-locking
> of that mode, but if it does, at least the breakage will be limited to
> that mode.

No.  font-lock-keywords-case-fold-search is purely a font-lock internal
variable.  Any buffer local value of it created outside of font-lock
gets ignored.  Setting its default value to anything other than nil will
break font-locking, as described above.

There is neither need nor sense in setting
font-lock-keywords-case-fold-search.  Instead, set element 2 of
font-lock-defaults to the desired setting.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).





reply via email to

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