[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the best (i.e. least bad) way to re-redisplay?

From: Alan Mackenzie
Subject: Re: What's the best (i.e. least bad) way to re-redisplay?
Date: Mon, 30 Aug 2021 18:10:46 +0000

Hello, Eli and Stefan.

On Thu, Aug 26, 2021 at 09:37:14 +0300, Eli Zaretskii wrote:
> > Date: Wed, 25 Aug 2021 20:09:24 +0000
> > From: Alan Mackenzie <acm@muc.de>
> > Cc: emacs-devel@gnu.org

> > > I think something along the lines of

> > >     (run-with-timer 0 nil
> > >                     (lambda (buf)
> > >                       (with-current-buffer buf (font-lock-flush)))
> > >                     (current-buffer))

> > > is the cleanest that comes to mind.

> > Thanks.  That's probably cleaner than a direct use of
> > jit-lock-force-redisplay.

> Why is it cleaner?  jit-lock and font-lock include provision for the
> fontification function to tell jit-lock what was the region actually
> fontified, and that will trigger a call to jit-lock-force-redisplay in
> a timer.  Why not use an existing mechanism?

In the end, I coded up a direct use of jit-lock-force-redisplay in a
one-time timer.  The reason I preferred this over font-lock-flush is that
j-l-f-r says in its doc string that it forces a redisplay, whereas f-l-f
merely says it declares (BEG END) as being out of date.

I hope to post my proposed new code on emacs-devel soon.

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]