bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#20404: 25.0.50; Sometimes no fontification with jit-lock-defer-time


From: Eli Zaretskii
Subject: bug#20404: 25.0.50; Sometimes no fontification with jit-lock-defer-time
Date: Thu, 23 Apr 2015 11:38:16 +0300

> Date: Thu, 23 Apr 2015 10:54:24 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 20404@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.





reply via email to

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