emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouse-autoselect-window with menu pane


From: Richard Stallman
Subject: Re: mouse-autoselect-window with menu pane
Date: Tue, 19 Sep 2006 18:57:01 -0400

    Anyway, does it make sense that a timer fires more frequently than
    prescribed by the REPEAT argument?

That is the wrong way to understand the implemented behavior.

Emacs can never promise to run a timer at the exact time
requested.  It can be late.

If you ask to run the timer every 2 seconds, Emacs will try to run it
a T+0 seconds, T+2 seconds, T+4 seconds, T+6 seconds, T+8 seconds,
T+10 seconds, etc.  But if it is busy from T+1 seconds thru T+7 seconds,
three of these calls will be delayed until T+7 seconds.

If you want to avoid this, you can

1. Have the timer function check the actual time
and do nothing if it is less than 1 second since the last call.

2. Have the timer function explicitly reschedule the timer for 2
seconds in the future, instead of using a 2-second repeating timer.

      A very quick simple
    test shows the behaviour seems consistent if the function run by the timer
    cancels the timer, when the function is run later due to buffering up of
    timers, in the scenario you describe.

I can't understand those words at all.

    > > Weird.  Suppose `mouse-autoselect-window-select' cancels the timer 
    > > after it fired the nth time, for some n > 2.  There's no reason why 
    > > the timer was not cancelled when it fired the (n - 1)th time.
    > > What's even more troubling: There's no reason why the timer shouldn't 
    > > fire a (n + 1)th time.

I can't understand those words either.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]