unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Markus Triska <markus.triska@gmx.at>
To: emacs-pretest-bug@gnu.org
Subject: bug#2930: 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels
Date: Wed, 08 Apr 2009 20:30:25 +0200	[thread overview]
Message-ID: <m27i1vknge.fsf@gmx.at> (raw)


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)))

When I replace the call of `accept-process-output' with (sleep-for
0.1), it also does not run the sentinel. (sit-for 0.1) works as
documented, but is not a good alternative for the other functions in
this case: If keyboard input is available, `sit-for' returns
immediately, so it is currently unfortunately also necessary to
discard keyboard input to make such a loop reliably run the sentinel.

In GNU Emacs 23.0.92.2 (i386-apple-darwin9.6.1, GTK+ Version 2.14.7)
 of 2009-04-05 on mt-imac.local
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--with-tiff=no''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t






             reply	other threads:[~2009-04-08 18:30 UTC|newest]

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

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=m27i1vknge.fsf@gmx.at \
    --to=markus.triska@gmx.at \
    --cc=2930@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    /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).