[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
idle-timer clock gets reset upon subprocess output.
From: |
D. Goel |
Subject: |
idle-timer clock gets reset upon subprocess output. |
Date: |
22 Jun 2002 21:15:52 -0400 |
;; BUG: i think: idle-timer clock gets reset upon subprocess output.
;; =================================================================
;; The example in this file displays a bug in idle-timers. I have
;; observed this bug with all sorts of (a)synchronous processes like
;; those occurring in eshell, ERC etc.
;; Basically, the manual says:
;; ,----
;; | ; Emacs can do various things while idle: garbage collect, autosave
;; | ;or handle data from a subprocess. But these interludes during
;; | ;idleness do not interfere with idle timers, because they do not reset
;; | ;the clock of idleness to zero. An idle timer set for 600 seconds
;; | ;will run when ten minutes have elapsed since the last user command
;; | ;was finished, even if subprocess output has been accepted thousands
;; | ;of times within those ten minutes, even if there have been garbage
;; | ;collections and autosaves.
;; `----
;; However, it seems that the clock does get reset every time a
;; subprocess output results.. I have tested this on emacs21.1 on
;; a dec_alpha.
;; The function below sets up a 7-second timer, and displays the
;; current time. And then runs a background process which returns
;; output in 5 seconds. After the 7-second timer is run, the
;; current-time is displayed again. The difference between the two
;; displayed times should be 7 seconds, but it is 12 seconds (= 7 +
;; 5).. IMHO, what happens is that when the process results in an
;; output, the timer-clock gets reset. Am i misinterpreting things?
;; Save this file to ~/.emacs.timer and do an
;; emacs21 -q -no-site-file -l ~/.emacs.timer
;; M-x test-timer
(defun test-timer ()
(interactive)
;; get done with dummy stuff and distracting messages
(require 'eshell)
(require 'timer)
(eshell)
(message "Starting stuff..")
(switch-to-buffer "*eshell*")
(goto-char (point-max))
(insert "echo Dummy input..")
(eshell-send-input)
;; done with irrelevant messages...
;; Start a 7-second timer... (which should show time after 7
;; seconds... however, it will actually show time after 12 seconds..)
(run-with-idle-timer 7 nil
'(lambda () (interactive)
(message
(format-time-string
"7 seconds reached, at %H:%M::%S"))))
;; echo the current time...
(message (format-time-string "Seven-second timer started at: %H:%M::%S"))
(switch-to-buffer "*eshell*")
(goto-char (point-max))
(insert "sleep 5")
(eshell-send-input))
====================================================
bug-header: -->
In GNU Emacs 21.1.3 (alphaev56-dec-osf4.0f, X toolkit, Xaw3d scroll bars)
of 2001-10-30 on shorty.csc.umd.edu
configured using `configure --prefix=/usr/local/gnu
--infodir=/usr/local/gnu/info/emacs-21.1 --with-kerberos --with-x
--with-x-toolkit=yes --with-xpm --with-jpeg --with-tiff --with-gif --with-png'
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: nil
locale-coding-system: nil
default-enable-multibyte-characters: t
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
- idle-timer clock gets reset upon subprocess output.,
D. Goel <=