Gnus development mailing list
 help / color / mirror / Atom feed
From: Harald Meland <Harald.Meland@usit.uio.no>
Cc: ding@ifi.uio.no
Subject: Re: Idleness
Date: 18 Nov 1997 03:46:02 +0100	[thread overview]
Message-ID: <d6dpvnyc42d.fsf@octarine.uio.no> (raw)
In-Reply-To: Hrvoje Niksic's message of "18 Nov 1997 00:05:57 +0100"

[Hrvoje Niksic]

| I think that:
| 
| 	* adding a new idle timer from the idle-timer callback
| 
| is less of a hack.  I wonder if it would work correctly?

I just did some simple testing, and it doesn't look like it would.  As
I noted in my previous mail, it appears that Emacs needs to go from a
non-idle state and remain idle for SECS seconds before FUNCTION is
called.

If you add an idle timer from the present idle timer FUNCTION, the new
FUNCTION will not get called before Emacs goes non-idle and then idle
again.

Of course you could add a non-idle timer, but this would have to check
whether Emacs has become non-idle every time it get's called, and I
can't find any way of determining that -- short of the present hack in
Gnus, and then we're back to square one, right?


BTW, here's the code I used for my testing.  Note that it will
positively break if the SECS argument used in the callback is larger
than the SECS argument in the separate `run-with-idle-timer' call, as
that would imply removing the spurious timer before it gets called.

(defvar harald-test-idle-timer-mother-timer nil)
(defvar harald-test-idle-timer-spurious-timer nil)

(defun harald-test-idle-timer-function ()
  (when harald-test-idle-timer-spurious-timer
    (cancel-timer harald-test-idle-timer-spurious-timer))
  (setq harald-test-idle-timer-spurious-timer
	(run-with-idle-timer 2 t 'harald-test-idle-timer-function))
  (message (current-time-string)))

(setq harald-test-idle-timer-mother-timer
      (run-with-idle-timer 5 t 'harald-test-idle-timer-function))
-- 
Harald


  reply	other threads:[~1997-11-18  2:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-16  2:06 Idleness Hrvoje Niksic
1997-11-17 15:32 ` Idleness Harald Meland
1997-11-17 18:37   ` Idleness Hrvoje Niksic
     [not found]     ` <x7hg9b70h7.fsf@peorth.gweep.net>
1997-11-17 21:41       ` Idleness Hrvoje Niksic
1997-11-17 22:40         ` Idleness Harald Meland
1997-11-17 23:05           ` Idleness Hrvoje Niksic
1997-11-18  2:46             ` Harald Meland [this message]
     [not found]         ` <x7n2j35dqa.fsf@peorth.gweep.net>
1997-11-17 23:51           ` Idleness Hrvoje Niksic

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=d6dpvnyc42d.fsf@octarine.uio.no \
    --to=harald.meland@usit.uio.no \
    --cc=ding@ifi.uio.no \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).