GNU bug report logs - #56637
28.1.90; [FR] Allow a way around font-lock-mode being unconditionally disabled in " *hidden*" buffers

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> gmail.com>

Date: Tue, 19 Jul 2022 04:15:02 UTC

Severity: normal

Found in version 28.1.90

Full log


Message #23 received at 56637 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 56637 <at> debbugs.gnu.org, yantar92 <at> gmail.com
Subject: Re: bug#56637: 28.1.90; [FR] Allow a way around font-lock-mode
 being unconditionally disabled in " *hidden*" buffers
Date: Tue, 19 Jul 2022 22:02:04 +0300
> 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.