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


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 56637 <at> debbugs.gnu.org
Subject: bug#56637: 28.1.90; [FR] Allow a way around font-lock-mode being unconditionally disabled in " *hidden*" buffers
Date: Mon, 25 Jul 2022 17:23:11 +0800
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> When font-lock-mode is active, char-property-alias-alist contains
>> '(face font-lock-face).
>
> Yes, I know, but it would really help to see a concrete case where that
> makes a difference, because there are various ways to "fix" this
> problem.  They all have upsides and downsides.

In my case, the main difference is in org-src-font-lock-fontify-block.
Its purpose is copying the text fontification from major mode buffer to
Org mode buffer. The copying is done by checking 'face and
font-lock-extra-managed-props properties, which is sufficient as long as
font-lock-mode is activated. When font-lock-mode is not activated,
copying 'face is not enough, and we have to copy 'font-lock-face.

>> Unless we can forever rely on the implementation detail that
>> 'font-lock-face is always equivalent to the 'face property,
> It's not really "equivalent", but more importantly it's not an
> implementation detail: it's documented in the ELisp manual.

Apart from 'font-lock-face, which can be copied explicitly, I do not see
any real issues.

Maybe only htmlize, which explicitly checks the value of font-lock-mode
variable and does something strange if it is nil.

Of course, htmlize is an external package. However, potentially, places
that check font-lock-mode value and can be used noninteractively may be
problematic:

1. align-rules-list
2. faces--attribute-at-point
3. font-lock-flush (it will fail to work when font-lock-mode is nil)
4. Info-fontify-node
5. c-toggle-comment-style
6. c-fontify-new-found-type
7. c-change-expand-fl-region
8. grep-process-setup
9. sh-set-shell
10. verilog-preprocess
11. reftex-show-entry

Best,
Ihor




This bug report was last modified 3 years and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.