[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#2930: 23.0.92; `accept-process-output' and `sleep-for' do not run se

From: Stefan Monnier
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>> 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
     (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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]