From: Jorgen Schaefer <forcer@forcix.cx>
Subject: Something is bogus with idle timers
Date: 07 Dec 2002 23:59:34 +0100 [thread overview]
Message-ID: <hhhedpbfl5.fsf@forcix.burse.uni-hamburg.de> (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"))
reply other threads:[~2002-12-07 22:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=hhhedpbfl5.fsf@forcix.burse.uni-hamburg.de \
--to=forcer@forcix.cx \
/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 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.