From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#19381: The doc string for `sit-for' is wrong; redisplay isn't unconditionally done. Date: Mon, 15 Dec 2014 10:35:17 +0000 Message-ID: <20141215103517.GA3435@acm.acm> References: <20141214171350.GA2606@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1418639790 9929 80.91.229.3 (15 Dec 2014 10:36:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Dec 2014 10:36:30 +0000 (UTC) Cc: 19381@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 15 11:36:22 2014 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 1Y0T0m-0000MO-No for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Dec 2014 11:36:20 +0100 Original-Received: from localhost ([::1]:38843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0T0m-0000Fh-7g for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Dec 2014 05:36:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0T0b-0000Fc-Vx for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 05:36:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0T0U-0004Te-EW for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 05:36:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0T0U-0004Ta-Ao for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 05:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y0T0T-0007W5-RJ for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 05:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Dec 2014 10:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19381 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19381-submit@debbugs.gnu.org id=B19381.141863974528870 (code B ref 19381); Mon, 15 Dec 2014 10:36:01 +0000 Original-Received: (at 19381) by debbugs.gnu.org; 15 Dec 2014 10:35:45 +0000 Original-Received: from localhost ([127.0.0.1]:46485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0T0C-0007Va-R4 for submit@debbugs.gnu.org; Mon, 15 Dec 2014 05:35:45 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:23675 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0T0A-0007VR-Db for 19381@debbugs.gnu.org; Mon, 15 Dec 2014 05:35:43 -0500 Original-Received: (qmail 91772 invoked by uid 3782); 15 Dec 2014 10:35:40 -0000 Original-Received: from acm.muc.de (pD951B9B2.dip0.t-ipconnect.de [217.81.185.178]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 15 Dec 2014 11:35:39 +0100 Original-Received: (qmail 3808 invoked by uid 1000); 15 Dec 2014 10:35:17 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:97348 Archived-At: Hello, Stefan. On Sun, Dec 14, 2014 at 06:31:29PM -0500, Stefan Monnier wrote: > > of "(sit-for 0)" in Emacs, and a lot of these are probably intended to > > mean "perform redisplay NOW". So it might be better to make > > `sit-for' always do a redisplay. > I'd need to see evidence of it. I've extracted all instances of "(sit-for 0)" to which a comment is appended (and stripped out the "(sit-for 0)" and numbered the lines) with the command: find . -name '*.el' | xargs grep -n '^[^;]*(sit-for 0).*;' | \ sed 's/\([^:]*:[^:]*:\)[^;]*\(.*\)/\1 \2/' | cat -b The result is this: 1 ./ehelp.el:223: ;necessary if last command was end-of-buffer or 2 ./emacs-lisp/edebug.el:2504: ; Force update and continue. 3 ./play/gomoku.el:993: ; Display NOW 4 ./play/gomoku.el:1036: ; Display NOW 5 ./play/gomoku.el:1127: ; Display NOW 6 ./play/landmark.el:884: ; Display NOW 7 ./play/landmark.el:926: ; Display NOW 8 ./play/landmark.el:1014: ; Display NOW 9 ./obsolete/terminal.el:627: ;get display to update 10 ./isearch.el:2991: ;make sure (window-start) is credible 11 ./ffap.el:366: ; display point movement 12 ./ffap.el:1502: ; display 13 ./ffap.el:1536: ; redraw original screen 14 ./ffap.el:1618: ; display 15 ./progmodes/compile.el:1754: ; Force redisplay 16 ./textmodes/page-ext.el:639: ; otherwise forward-line fails if N > window height. 17 ./textmodes/ispell.el:2749: ; update display 18 ./textmodes/ispell.el:2753: ; update display showing inverse video. 19 ./net/rcirc.el:1657: ; displayed text before hook 20 ./shell.el:988: ; force redisplay 21 ./shell.el:1067: ; force redisplay 22 ./emulation/cua-rect.el:769: ; make window top/bottom reliable 23 ./emulation/viper-macs.el:201: ; this overcomes xemacs tty bug 24 ./vc/ediff-mult.el:2103: ; sometimes needed to synch the display and ensure that the 25 ./vc/ediff.el:945: ; sync before using window-start/end -- a precaution 26 ./vc/smerge-mode.el:403: ;Display the new highlighting. 27 ./vc/ediff-ptch.el:717: ; synchronize - let the user see diagnostics That's ~20% of the instances. Let's assume, for want of a better hypothesis, that these 27 uses are representative of the 125 in total. Of these, 1, 2, 10, 15, 16, 20, 21, 22, 25 state that redisplay is forced, or give a reason why redisplay is needed. That's 9 out of 27, a third. It is impossible to say from this whether the rest of the 27 absolutely need immediate redisplay or not. Some of them might well do. Extrapolating that to the 125 instances of "(sit-for 0)" suggests around 42 of them (at least) want immediate redisplay. > Stefan -- Alan Mackenzie (Nuremberg, Germany).