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#2930: 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels Date: Mon, 17 Aug 2009 11:36:56 -0400 Message-ID: References: <87eircjz9o.fsf@cyd.mit.edu> Reply-To: Stefan Monnier , 2930@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250524093 26324 80.91.229.12 (17 Aug 2009 15:48:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Aug 2009 15:48:13 +0000 (UTC) Cc: 2930@emacsbugs.donarmstrong.com, Markus Triska To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 17 17:48:06 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Md4RC-0004P1-06 for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Aug 2009 17:47:58 +0200 Original-Received: from localhost ([127.0.0.1]:47956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Md4RB-0005lt-Br for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Aug 2009 11:47:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Md4QE-0005P4-DV for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 11:46:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Md4Q9-0005Jv-MS for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 11:46:58 -0400 Original-Received: from [199.232.76.173] (port=51745 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Md4Q9-0005Jn-Gx for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 11:46:53 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55119) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Md4Q8-0005zv-UH for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 11:46:53 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7HFkokH006228; Mon, 17 Aug 2009 08:46:50 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7HFj4F0005895; Mon, 17 Aug 2009 08:45:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 17 Aug 2009 15:45:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2930 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2930-submit@emacsbugs.donarmstrong.com id=B2930.12505234234652 (code B ref 2930); Mon, 17 Aug 2009 15:45:04 +0000 Original-Received: (at 2930) by emacsbugs.donarmstrong.com; 17 Aug 2009 15:37:03 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7HFb1tU004645 for <2930@emacsbugs.donarmstrong.com>; Mon, 17 Aug 2009 08:37:03 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhAFAL8ViUpFpZNo/2dsb2JhbACBUsYVCI5XgkUIgUwFgjmFEA X-IronPort-AV: E=Sophos;i="4.43,396,1246852800"; d="scan'208";a="43662706" Original-Received: from 69-165-147-104.dsl.teksavvy.com (HELO pastel.home) ([69.165.147.104]) by ironport2-out.teksavvy.com with ESMTP; 17 Aug 2009 11:36:25 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4D6AC82F0; Mon, 17 Aug 2009 11:36:56 -0400 (EDT) In-Reply-To: <87eircjz9o.fsf@cyd.mit.edu> (Chong Yidong's message of "Sat, 15 Aug 2009 21:58:11 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 17 Aug 2009 11:46:57 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30311 Archived-At: >> The documentation for sentinels states: >> A program can wait, so that sentinels will run, by calling >> `sit-for' or `sleep-for' (...), or `accept-process-output' (...). >> >> However, when I do M-x eval-region RET on the following forms in >> "emacs -Q", then Emacs loops unexpectedly: >> >> (defun my-sentinel (proc str) >> (setq my-finished t)) >> >> (let ((p (start-process "bc" nil "bc")) >> my-finished) >> (set-process-sentinel p 'my-sentinel) >> (process-send-string p "quit\n") >> (while (not my-finished) >> (accept-process-output nil 0.1))) > The trouble is that accept-process-output passes a zero DO_DISPLAY > argument to wait_reading_process_output (process.c:4306). When > DO_DISPLAY is zero, status notifications are not performed > (process.c:4763). > Having accept-process-output pass a non-zero DO_DISPLAY argument to > wait_reading_process_output fixes this problem, but I don't know what > ramifications this would have. I don't know. You already changed it in that direction a year ago: timestamp: Mon 2008-05-19 22:29:33 +0000 message: (wait_reading_process_output): Always check status when in batch mode. so maybe we should change it even further? I think a good change would be to change the code of wait_reading_process_output such that status changes are taken into account (even when do_display is 0) but only for the process(es) for which we're waiting. Stefan