unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Clément Pit--Claudel" <clement.pitclaudel@live.com>
Cc: 25672@debbugs.gnu.org
Subject: bug#25672: Font-locking issues when font-lock-fontified is nil
Date: Wed, 30 Oct 2019 17:07:10 +0100	[thread overview]
Message-ID: <877e4mrzdd.fsf@gnus.org> (raw)
In-Reply-To: <d404b5e2-7a39-6dc2-087d-24ced309bb9b@live.com> ("Clément Pit--Claudel"'s message of "Thu, 9 Feb 2017 16:22:21 -0500")

Clément Pit--Claudel <clement.pitclaudel@live.com> writes:

> Eli remarked the following:
>
>> However, please explain why font-lock-ensure-function calls
>> font-lock-DEFAULT-fontify-buffer.  If it's supposed to be good for
>> any mode, why
>> does it call the default fontification?
>>
>> As a matter of fact, if I replace the font-lock-default-fontify-buffer
>> call with a call to font-lock-fontify-buffer, the problem described by
>> the OP goes away.  That is why I said what I said.
>
> And Stefan answered:
>
>> I haven't seen the beginning of the thread, but if that fixes the
>> problem, then I think it's a good change.
>>
>> To go back to the previous question.  I guess I used
>> font-lock-default-fontify-buffer because the whole point is to get rid
>> of all the misuses of font-lock-fontify-buffer, but I think in this case
>> it's indeed the right thing to do.

I think this was fixed last year-ish if I'm reading the change log
correctly.

Currently, font-lock-ensure calls the value of
font-lock-ensure-function, which has a default value of

  (lambda (beg end)
    (unless font-lock-fontified
      (save-excursion
        (font-lock-fontify-region beg end))))

If global-font-lock-mode is on, it's jit-lock-fontify-now.

So I think this now works better, and I'm closing this bug report.  If
this is still an issue, please reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2019-10-30 16:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 21:22 bug#25672: Font-locking issues when font-lock-fontified is nil (Was: What to do when font-lock-flush + font-lock-ensure do less than font-lock-fontify-buffer? on emacs-devel) Clément Pit--Claudel
2019-10-30 16:07 ` Lars Ingebrigtsen [this message]
2019-10-30 16:09   ` bug#25672: Font-locking issues when font-lock-fontified is nil Lars Ingebrigtsen
2021-08-14 14:17     ` bug#25672: Font-locking issues when font-lock-fontified is nil (Was: What to do when font-lock-flush + font-lock-ensure do less than font-lock-fontify-buffer? on emacs-devel) Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=877e4mrzdd.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=25672@debbugs.gnu.org \
    --cc=clement.pitclaudel@live.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).