unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: tsdh@gnu.org
Cc: 20404@debbugs.gnu.org
Subject: bug#20404: 25.0.50; Sometimes no fontification with jit-lock-defer-time
Date: Thu, 23 Apr 2015 11:38:16 +0300	[thread overview]
Message-ID: <831tjb2q9z.fsf@gnu.org> (raw)
In-Reply-To: <83383r2sb3.fsf@gnu.org>

> 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	other threads:[~2015-04-23  8:38 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22  9:45 bug#20404: 25.0.50; Sometimes no fontification with jit-lock-defer-time Tassilo Horn
2015-04-22 10:32 ` Eli Zaretskii
2015-04-22 20:32   ` Tassilo Horn
2015-04-22 21:39     ` Eli Zaretskii
2015-04-23  5:59       ` Tassilo Horn
2015-04-23  6:14         ` Eli Zaretskii
2015-04-23  8:36           ` Tassilo Horn
     [not found] ` <mailman.1344.1429696032.904.bug-gnu-emacs@gnu.org>
2015-04-22 16:31   ` Alan Mackenzie
2015-04-22 17:37     ` Stefan Monnier
2015-04-22 19:32       ` Alan Mackenzie
2015-04-22 20:52         ` Stefan Monnier
2015-04-22 20:10       ` Tassilo Horn
2015-04-22 21:33         ` Eli Zaretskii
2015-04-23  4:15           ` Tassilo Horn
2015-04-23  6:35             ` Eli Zaretskii
2015-04-23 13:40               ` Stefan Monnier
2015-04-23 15:11                 ` Eli Zaretskii
2015-04-23 16:23                   ` Stefan Monnier
2015-04-23 17:03                     ` Eli Zaretskii
2015-04-23 17:27                       ` Stefan Monnier
2015-04-23 17:34                         ` Eli Zaretskii
2015-04-23 19:35                           ` Stefan Monnier
2015-04-24  9:41                             ` Eli Zaretskii
2015-04-24 14:03                               ` Stefan Monnier
2015-04-24 14:36                                 ` Eli Zaretskii
2015-04-24 18:03                                   ` Stefan Monnier
2015-04-23 19:53                       ` Tassilo Horn
2015-04-23 17:25                     ` Eli Zaretskii
2015-04-23 19:31                       ` Stefan Monnier
2015-04-23 19:52                         ` Eli Zaretskii
2015-04-23 19:56                         ` Tassilo Horn
2015-04-23  7:54 ` Eli Zaretskii
2015-04-23  8:38   ` Eli Zaretskii [this message]
2015-04-23  9:04     ` Tassilo Horn
2015-04-23  9:16       ` Eli Zaretskii
2015-04-23 13:40     ` Stefan Monnier
2019-10-31 14:23     ` Lars Ingebrigtsen
2019-10-31 14:51       ` Eli Zaretskii
2015-04-23  8:38   ` Tassilo Horn

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=831tjb2q9z.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=20404@debbugs.gnu.org \
    --cc=tsdh@gnu.org \
    /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).