GNU bug report logs -
#56637
28.1.90; [FR] Allow a way around font-lock-mode being unconditionally disabled in " *hidden*" buffers
Previous Next
Full log
View this message in rfc822 format
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: yantar92 <at> gmail.com, 56637 <at> debbugs.gnu.org
> Date: Tue, 19 Jul 2022 13:01:38 -0400
>
> >> FWIW, I do think it would be good to remove the rule that font-lock is
> >> never enabled in temp buffers.
> > I don't.
>
> I think we agree :-)
>
> More seriously, I didn't mean to remove it willy-nilly, but that it's
> a desirable goal and the question is how to get there.
Why is that a desirable goal? It slows down stuff that is never
displayed. And if that buffer has very long lines, it slows Emacs
down considerably. I see no reason whatsoever to pay this price, let
alone the garbage font-lock generates.
From my POV, this has "non-starter" written all over it.
> We could start by adding a new variable
> `font-lock-allow-in-temporary-buffer`, which packages could set
> buffer-locally in those rare temp buffers where they do want to enable
> font-lock, as in the untested patch below.
This is a slippery slope. Next some other corner case will want to
run buffer-modification hooks in a temporary buffer, so we invent
another variable, and so on and so forth.
I'd rather introduce a macro like with-temp-buffer, but one that can
accept a buffer name, and ask such applications to please name their
temporary buffers something that doesn't begin with a space.
This bug report was last modified 2 years and 327 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.