all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: 68849@debbugs.gnu.org, Kostas Papadakis <papadakis.k@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	[thread overview]
Message-ID: <jwvwmrljsme.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <875xz9oep2.fsf@localhost> (Ihor Radchenko's message of "Wed, 31 Jan 2024 12:44:09 +0000")

> 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






  parent reply	other threads:[~2024-02-03 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 12:44 bug#68849: 30.0.50; font-lock does not flush fontification after calling open-line Ihor Radchenko
2024-02-03  9:55 ` Eli Zaretskii
2024-02-03 18:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-02-04 13:33   ` Ihor Radchenko
2024-02-04 14:24     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvwmrljsme.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68849@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=papadakis.k@yandex.com \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.