* Something is bogus with idle timers
@ 2002-12-07 22:59 Jorgen Schaefer
0 siblings, 0 replies; only message in thread
From: Jorgen Schaefer @ 2002-12-07 22:59 UTC (permalink / raw)
Hi there!
I'm using "GNU Emacs 21.2.2 (i386-pc-linux-gnu, X toolkit, Xaw3d
scroll bars) of 2002-10-16 on raven, modified by Debian" and need
a pretty long-running idle timer (about 10 to 30 minutes). Adding
it using run-with-idle-timer, i found out it was never run.
It seems like emacs is resetting the idle timer sometimes (not
always) when it gets data for a process that has a filter. I don't
think this is wanted behaviour, right? From (elisp)Timers:
| Emacs becomes "idle" when it starts waiting for user input, and
| it remains idle until the user provides some input.
| [...]
| 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.
Can someone tell me what exactly besides user keyboard stuff
resets the idle timer? I couldn't find that much from the sources.
I used the following code to check wether Emacs got out of the
idle state:
(setq fc-idle-timer nil)
(defun fc-idle-test ()
(interactive)
(when fc-idle-timer
(cancel-timer fc-idle-timer))
(setq fc-idle-num 0)
(setq fc-idle-timer (run-with-idle-timer 1 t 'fc-idle-meep)))
(defun fc-idle-meep ()
(message "meep %i." fc-idle-num)
(setq fc-idle-num (+ fc-idle-num 1)))
Since emacs runs a function only once for becoming idle, this will
message "meep" with an increasing number everytime emacs becomes
non-idle.
The following code will make emacs drop out of idleness
*sometimes* when receiving data from nc (I usually have to wait
for half a minute or so, after which sending data through the
process will reset the idle-timer each time i send). You should do
nc -lp 2000 before running this code to send data to emacs.
(setq process (start-process "nc" "*nc*" "nc" "localhost" "2000"))
(set-process-filter process 'fc-filter)
(defun fc-filter (proc data)
t)
Any idea what is happening?
Greetings,
-- Jorgen
--
((email . "forcer@forcix.cx") (www . "http://www.forcix.cx/")
(gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet"))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-12-07 22:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-07 22:59 Something is bogus with idle timers Jorgen Schaefer
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.