[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: |
Wed, 25 Aug 2021 20:09:24 +0000 |
Hello, Stefan.
On Tue, Aug 24, 2021 at 18:43:04 -0400, Stefan Monnier wrote:
> > The problem is, there will be occurences in the foreground window before
> > the one which triggered the fontification. Redisplay will already have
> > passed this earlier buffer position. So I need to trigger another
> > redisplay immediately after the current one.
> > What is the least bad way of doing this?
> 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. I'll just need to add BEG and END into that,
somehow, but font-lock-flush has these as &optional parameters, so that
won't be a problem.
But, looking at the code, font-lock-flush works by clearing the
'fontified property, nothing more. This won't always trigger a
redisplay, will it? Doesn't it need after-change-functions to be active
at the time? Maybe after-change-functions will always be active during
a redisplay (and hence immediately after redisplay completes), but my
head's beginning to hurt.
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).
- What's the best (i.e. least bad) way to re-redisplay?, Alan Mackenzie, 2021/08/23
- Re: What's the best (i.e. least bad) way to re-redisplay?, Eli Zaretskii, 2021/08/23
- Re: What's the best (i.e. least bad) way to re-redisplay?, Stefan Monnier, 2021/08/24
- Re: What's the best (i.e. least bad) way to re-redisplay?,
Alan Mackenzie <=
- Re: What's the best (i.e. least bad) way to re-redisplay?, Stefan Monnier, 2021/08/25
- Re: What's the best (i.e. least bad) way to re-redisplay?, Eli Zaretskii, 2021/08/26
- Re: What's the best (i.e. least bad) way to re-redisplay?, Stefan Monnier, 2021/08/26
- Re: What's the best (i.e. least bad) way to re-redisplay?, Alan Mackenzie, 2021/08/26
- Re: What's the best (i.e. least bad) way to re-redisplay?, Stefan Monnier, 2021/08/26
- Re: What's the best (i.e. least bad) way to re-redisplay?, Alan Mackenzie, 2021/08/30