GNU bug report logs - #2930
23.0.92; `accept-process-output' and `sleep-for' do not run sentinels

Previous Next

Package: emacs;

Reported by: Markus Triska <markus.triska <at> gmx.at>

Date: Wed, 8 Apr 2009 18:40:05 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #30 received at 2930 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Markus Triska <markus.triska <at> gmx.at>, 2930 <at> debbugs.gnu.org
Subject: Re: 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels
Date: Mon, 17 Aug 2009 11:36:56 -0400
>> 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



This bug report was last modified 15 years and 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.