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 #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Markus Triska <markus.triska <at> gmx.at>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels
Date: Wed, 08 Apr 2009 20:30:25 +0200
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




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.