unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 2930@emacsbugs.donarmstrong.com, Markus Triska <markus.triska@gmx.at>
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	[thread overview]
Message-ID: <jwvd46ucw8q.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <87eircjz9o.fsf@cyd.mit.edu> (Chong Yidong's message of "Sat, 15 Aug 2009 21:58:11 -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





  reply	other threads:[~2009-08-17 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-16  1:58 bug#2930: 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels Chong Yidong
2009-08-17 15:36 ` Stefan Monnier [this message]
2009-08-17 21:04   ` Chong Yidong
     [not found] ` <mailman.4807.1250524020.2239.bug-gnu-emacs@gnu.org>
2009-08-17 16:34   ` Markus Triska
  -- strict thread matches above, loose matches on Subject: below --
2009-04-08 18:30 Markus Triska
2009-04-08 21:11 ` Stefan Monnier
     [not found] ` <mailman.4941.1239225840.31690.bug-gnu-emacs@gnu.org>
2009-04-08 21:29   ` Markus Triska

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd46ucw8q.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=2930@emacsbugs.donarmstrong.com \
    --cc=cyd@stupidchicken.com \
    --cc=markus.triska@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).