all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* idle-timer clock gets reset upon subprocess output.
@ 2002-06-23  1:15 D. Goel
  2002-06-23  1:18 ` D. Goel
  2002-06-27 16:45 ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: D. Goel @ 2002-06-23  1:15 UTC (permalink / raw)



;; 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:

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-04  6:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-23  1:15 idle-timer clock gets reset upon subprocess output D. Goel
2002-06-23  1:18 ` D. Goel
2002-06-27 16:45 ` Richard Stallman
2002-07-04  6:15   ` D. Goel

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.