GNU bug report logs - #69431
30.0.50; Strange fontificaion behavior

Previous Next

Package: emacs;

Reported by: OGAWA Hirofumi <hirofumi <at> mail.parknet.co.jp>

Date: Tue, 27 Feb 2024 17:16:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Andrea Corallo <acorallo <at> gnu.org>
Cc: 69431 <at> debbugs.gnu.org,
 Björn Bidar <bjorn.bidar <at> thaodan.de>,
 Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 hirofumi <at> mail.parknet.co.jp
Subject: Re: bug#69431: 30.0.50; Strange fontificaion behavior
Date: Mon, 01 Apr 2024 10:59:13 +0000
Andrea Corallo <acorallo <at> gnu.org> writes:

> I've applied the following:
>
>  (defun font-lock-set-defaults ()
> ...
> +    (when (string= (buffer-name) "test.org")
> +      (add-variable-watcher 'font-lock-keywords #'k-variable-watcher))
>
> Warm eln-cache (working fontification)
> ================
> For information about GNU Emacs and the GNU system, type C-h C-a.
> XXX set
>   backtrace()
>   k-variable-watcher(font-lock-keywords ... set #<buffer test.org>)
>   normal-mode(t)
>
> XXX set
>   backtrace()
>   k-variable-watcher(font-lock-keywords ... set #<buffer test.org>)
> ...
>   jit-lock-function(1)
>
> Empty eln-cache (fontification broken):
> ================
> For information about GNU Emacs and the GNU system, type C-h C-a.
> XXX makunbound
>   backtrace()
>   k-variable-watcher(font-lock-keywords nil makunbound #<buffer test.org>)
>   kill-local-variable(font-lock-keywords)
>   org-set-font-lock-defaults()
>   org-mode()
> ...
> XXX set
>   backtrace()
>   k-variable-watcher(font-lock-keywords (t nil) set nil)
> ...
>   jit-lock-function(1)
>
> ================
>
> So from what I see in the non working example 'font-lock-keywords' is
> cleared at the end of 'org-set-font-lock-defaults' which does
> '(kill-local-variable 'font-lock-keywords)'.
>
> Now why this is not happening in the working example I'm not sure ATM,
> ('org-set-font-lock-defaults' is not even called there AFAICS).

I am pretty sure that it does get called, but before your variable
watcher becomes active.

I suspect that font-lock is dumped to Emacs.
Maybe related to bug#66741.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 1 year and 121 days ago.

Previous Next


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