From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20404: 25.0.50; Sometimes no fontification with jit-lock-defer-time Date: Thu, 23 Apr 2015 11:38:16 +0300 Message-ID: <831tjb2q9z.fsf@gnu.org> References: <87a8y0iji1.fsf@gnu.org> <83383r2sb3.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1429778363 14100 80.91.229.3 (23 Apr 2015 08:39:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Apr 2015 08:39:23 +0000 (UTC) Cc: 20404@debbugs.gnu.org To: tsdh@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 23 10:39:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YlCfA-0005Ce-16 for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Apr 2015 10:39:12 +0200 Original-Received: from localhost ([::1]:38885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlCf9-0001SR-6s for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Apr 2015 04:39:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlCf5-0001S5-Fb for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2015 04:39:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlCf0-0006d0-FB for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2015 04:39:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlCf0-0006cw-Bp for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2015 04:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YlCf0-0004VB-50 for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2015 04:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Apr 2015 08:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20404 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20404-submit@debbugs.gnu.org id=B20404.142977830717245 (code B ref 20404); Thu, 23 Apr 2015 08:39:02 +0000 Original-Received: (at 20404) by debbugs.gnu.org; 23 Apr 2015 08:38:27 +0000 Original-Received: from localhost ([127.0.0.1]:37111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YlCeP-0004U4-Tw for submit@debbugs.gnu.org; Thu, 23 Apr 2015 04:38:26 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:64871) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YlCeN-0004Tn-AH for 20404@debbugs.gnu.org; Thu, 23 Apr 2015 04:38:24 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NN9007003M5OE00@a-mtaout21.012.net.il> for 20404@debbugs.gnu.org; Thu, 23 Apr 2015 11:38:16 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NN9007LO3ZQOR00@a-mtaout21.012.net.il>; Thu, 23 Apr 2015 11:38:15 +0300 (IDT) In-reply-to: <83383r2sb3.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101910 Archived-At: > Date: Thu, 23 Apr 2015 10:54:24 +0300 > From: Eli Zaretskii > 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.