GNU bug report logs -
#20404
25.0.50; Sometimes no fontification with jit-lock-defer-time
Previous Next
Reported by: Tassilo Horn <tsdh <at> gnu.org>
Date: Wed, 22 Apr 2015 09:47:01 UTC
Severity: normal
Tags: moreinfo
Found in version 25.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Thu, 23 Apr 2015 10:54:24 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 20404 <at> debbugs.gnu.org
>
> > 1. emacs -Q
> > 2. eval my above settings in *scratch*
> > 3. M-x report-emacs-bug
> >
> > The new message buffer is completely unfontified initially.
>
> I've reproduced this recipe. The fontification happens about 2.5 sec
> after the buffer is initially displayed. I've noticed that the cursor
> also doesn't blink during these few seconds, which seems to imply that
> Emacs simply doesn't "become idle" during that time, or maybe doesn't
> run _any_ idle timers during that time for some other reason.
>
> Btw, it is enough to set jit-lock-defer-time to something non-zero, to
> have this effect; the other 2 customizations seem not to affect this.
Moreover, here's what seems to be a much simpler recipe that shows the
underlying problem:
emacs -Q
M-x blink-cursor-mode RET
M-x blink-cursor-mode RET
And note that after the second "M-x blink-cursor-mode RET", which
turns ON the blinking, Emacs waits for about the same 2 sec before it
actually starts blinking.
And here's why: _any_ command that goes through
execute-extended-command will run this code:
(when suggest-key-bindings
(sit-for (cond
((zerop (length (current-message))) 0)
((numberp suggest-key-bindings) suggest-key-bindings)
(t 2))))))
The default value of suggest-key-bindings is t, so this means we
_always_ sit-for 2 seconds, unless the echo area shows nothing (a rare
situation in Emacs). When Emacs is parked inside sit-for, it doesn't
become idle, I think for good reasons. So the idle timers will not
run until those 2 sec have expired, or some input becomes available.
And indeed setting suggest-key-bindings to nil causes the buffer
displayed by report-emacs-bug to become fontified almost immediately,
under Tassilo's settings of jit-lock-defer-time.
The upshot of all this is that any command that displays a buffer via
execute-extended-command and also says something in the echo area,
will always delay JIT deferred fontifications (and any other features
that run via idle timers) for at least 2 sec.
This bug report was last modified 5 years and 282 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.