From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier 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 13:50:25 -0500 Message-ID: References: <20141214171350.GA2606@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1418669547 24178 80.91.229.3 (15 Dec 2014 18:52:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Dec 2014 18:52:27 +0000 (UTC) Cc: 19381-done@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 15 19:52:14 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 1Y0akd-0004kQ-Tj for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Dec 2014 19:52:12 +0100 Original-Received: from localhost ([::1]:41450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0akd-00019I-IQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Dec 2014 13:52:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0aje-0007xM-Bx for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 13:51:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0ajW-0005kN-Rd for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 13:51:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ajW-0005kH-Or for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 13:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y0ajW-0004Cd-8w for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 13:51:02 -0500 Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Dec 2014 18:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 19381 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 19381@debbugs.gnu.org, monnier@iro.umontreal.ca, acm@muc.de Original-Received: via spool by 19381-done@debbugs.gnu.org id=D19381.141866945416135 (code D ref 19381); Mon, 15 Dec 2014 18:51:01 +0000 Original-Received: (at 19381-done) by debbugs.gnu.org; 15 Dec 2014 18:50:54 +0000 Original-Received: from localhost ([127.0.0.1]:47151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0ajN-0004CA-DJ for submit@debbugs.gnu.org; Mon, 15 Dec 2014 13:50:53 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:43747) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0ajL-0004Bu-9p for 19381-done@debbugs.gnu.org; Mon, 15 Dec 2014 13:50:52 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwPAOwQflTO+ILA/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMFCwsOJhIUGA0kLogcCdZZAQEBAQYBAQEBHpBvB4RIBYsBpC6BeII3gWIhgncBAQE X-IPAS-Result: AjwPAOwQflTO+ILA/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMFCwsOJhIUGA0kLogcCdZZAQEBAQYBAQEBHpBvB4RIBYsBpC6BeII3gWIhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102565707" Original-Received: from 206-248-130-192.dsl.teksavvy.com (HELO ceviche.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Dec 2014 13:50:45 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 18E70660FB; Mon, 15 Dec 2014 13:50:25 -0500 (EST) In-Reply-To: <20141214171350.GA2606@acm.acm> (Alan Mackenzie's message of "Sun, 14 Dec 2014 17:13:50 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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:97365 Archived-At: > The doc string for `sit-for', in its first (and most important) line > states unequivocally that redisplay is performed. (That line is "Perform > redisplay, then wait for SECONDS seconds or until input is available.") > That's not what the function currently does - it doesn't perform > redisplay if input is already available when it is called. I've changed it to say: "Redisplay, then wait for SECONDS seconds. Stop when input is available. So that the "when input is available" part is not so closely tied to the "wait" part but can also apply to the "redisplay" part. > It would seem at first sight that the obvious thing to do is correct the > first line of the doc string. However there are lots (125) of instances > 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. While fixing the docstring, I also saw that the code of sit-for hints at the solution to the above problem: if you just want to redisplay, don't call (sit-for 0), but call `redisplay' instead (where the `force' argument can be used to decide whether pending input should prevent redisplay or not). Stefan