GNU bug report logs - #68849
30.0.50; font-lock does not flush fontification after calling open-line

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Wed, 31 Jan 2024 12:42:02 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 68849 <at> debbugs.gnu.org, Kostas Papadakis <papadakis.k <at> yandex.com>
Subject: bug#68849: 30.0.50; font-lock does not flush fontification after calling open-line
Date: Sat, 03 Feb 2024 13:46:58 -0500
> I am not 100% sure if is Emacs bug, but my preliminary testing showed
> anomalies in `jit-lock-after-change' -
> (put-text-property jit-lock-start jit-lock-end 'fontified nil) somehow
> did not apply the text properties. I suspect that I missed something
> though.

AFAICT the `put-text-property` works fine :-)
The problem is that your `org-fontify-extend-region` does not spread the
change to the "next line".

When `font-lock-extend-after-change-region-function` is nil, Emacs does
that for you.  Quoting `font-lock-extend-jit-lock-region-after-change`:

      (when (< end (point-max))
        (setq end
              (cond
               ((get-text-property end 'font-lock-multiline)
                (or (text-property-any end (point-max)
                                       'font-lock-multiline nil)
                    (point-max)))
               ;; If `end' has been set by the function above, don't corrupt it.
               (font-lock-extend-after-change-region-function end)
                ;; Rounding up to a whole number of lines should include the
                ;; line right after `end'.  Typical case: the first char of
                ;; the line was deleted.  Or a \n was inserted in the middle
                ;; of a line.
               (t (1+ end)))))

I still hope you can change Org mode so it uses
`font-lock-extend-region-functions` instead of
`font-lock-extend-after-change-region-function`.


        Stefan





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

Previous Next


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