* bug#5822: run-at-time and Setting system time
2010-04-02 17:40 ` bug#5822: " Eli Zaretskii
@ 2009-04-05 3:44 ` chandan
0 siblings, 0 replies; 5+ messages in thread
From: chandan @ 2009-04-05 3:44 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 5822, help-gnu-emacs
Eli Zaretskii wrote:
>> Date: Fri, 02 Apr 2010 12:29:42 +0530
>> From: chandan <chandan.babu@globaledgesoft.com>
>> Cc:
>>
>> (defun mwnn-timer-callback ()
>> (message "Hi, inside mwnn-timer-callback"))
>>
>> (run-at-time "60" nil 'mwnn-timer-callback)
>>
>> The above code is supposed to cause mwnn-timer-callback to get invoked
>> after 60 seconds. But if the system time is changed to a future date
>> (say 20 seconds after the timer is started) the timer fires immediately.
>>
>> Is this is a bug in the emacs code. If yes, can this be rectified?
>>
>
> I think this how the timers are supposed to behave. They are not
> interval timers, if that's what you expected.
>
>
Emacs seems to use setitimer & getitimer (interval timers) for
implementing the timer module. This may be the cause of the problem.
Using timer_create, timer_delete, timer_settime, timer_gettime etc.
^ permalink raw reply [flat|nested] 5+ messages in thread
* run-at-time and Setting system time
@ 2010-04-02 6:59 chandan
2010-04-02 17:36 ` J. David Boyd
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: chandan @ 2010-04-02 6:59 UTC (permalink / raw)
To: help-gnu-emacs, bug-gnu-emacs
Hi,
Consider the following code:
(defun mwnn-timer-callback ()
(message "Hi, inside mwnn-timer-callback"))
(run-at-time "60" nil 'mwnn-timer-callback)
The above code is supposed to cause mwnn-timer-callback to get invoked
after 60 seconds. But if the system time is changed to a future date
(say 20 seconds after the timer is started) the timer fires immediately.
Is this is a bug in the emacs code. If yes, can this be rectified?
Regards,
mwnn
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: run-at-time and Setting system time
2010-04-02 6:59 run-at-time and Setting system time chandan
@ 2010-04-02 17:36 ` J. David Boyd
2010-04-02 17:40 ` bug#5822: " Eli Zaretskii
2010-04-02 18:55 ` Glenn Morris
2 siblings, 0 replies; 5+ messages in thread
From: J. David Boyd @ 2010-04-02 17:36 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: bug-gnu-emacs
chandan <chandan.babu@globaledgesoft.com> writes:
> Hi,
> Consider the following code:
>
> (defun mwnn-timer-callback ()
> (message "Hi, inside mwnn-timer-callback"))
>
> (run-at-time "60" nil 'mwnn-timer-callback)
>
> The above code is supposed to cause mwnn-timer-callback to get invoked
> after 60 seconds. But if the system time is changed to a future date
> (say 20 seconds after the timer is started) the timer fires
> immediately.
>
> Is this is a bug in the emacs code. If yes, can this be rectified?
>
> Regards,
> mwnn
It sounds like a good thing to me.
Say the time is 13:00, and you do what you said. You told the machine
to give an invocation at 13:01.
If you move the clock ahead, the code _should_ run, as it is now past
13:01.
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bug#5822: run-at-time and Setting system time
2010-04-02 6:59 run-at-time and Setting system time chandan
2010-04-02 17:36 ` J. David Boyd
@ 2010-04-02 17:40 ` Eli Zaretskii
2009-04-05 3:44 ` chandan
2010-04-02 18:55 ` Glenn Morris
2 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2010-04-02 17:40 UTC (permalink / raw)
To: chandan; +Cc: 5822, help-gnu-emacs
> Date: Fri, 02 Apr 2010 12:29:42 +0530
> From: chandan <chandan.babu@globaledgesoft.com>
> Cc:
>
> (defun mwnn-timer-callback ()
> (message "Hi, inside mwnn-timer-callback"))
>
> (run-at-time "60" nil 'mwnn-timer-callback)
>
> The above code is supposed to cause mwnn-timer-callback to get invoked
> after 60 seconds. But if the system time is changed to a future date
> (say 20 seconds after the timer is started) the timer fires immediately.
>
> Is this is a bug in the emacs code. If yes, can this be rectified?
I think this how the timers are supposed to behave. They are not
interval timers, if that's what you expected.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#5822: run-at-time and Setting system time
2010-04-02 6:59 run-at-time and Setting system time chandan
2010-04-02 17:36 ` J. David Boyd
2010-04-02 17:40 ` bug#5822: " Eli Zaretskii
@ 2010-04-02 18:55 ` Glenn Morris
2 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2010-04-02 18:55 UTC (permalink / raw)
To: chandan; +Cc: 5822, help-gnu-emacs
Please don't cross-post to the help and bug lists.
Anyone reading this on help-gnu-emacs, please use 5822 at
debbugs.gnu.org in place of bug-gnu-emacs in any replies. (Otherwise
every reply creates a new bug report.)
If you really want to cc another address when filing a new bug report,
please use an X-Debbugs-CC header instead of a Cc header, as explained
here:
http://debbugs.gnu.org/Reporting.html#xcc
Yes, it is a bit confusing at first.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-02 18:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-02 6:59 run-at-time and Setting system time chandan
2010-04-02 17:36 ` J. David Boyd
2010-04-02 17:40 ` bug#5822: " Eli Zaretskii
2009-04-05 3:44 ` chandan
2010-04-02 18:55 ` Glenn Morris
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 read-only IMAP folder(s) and NNTP newsgroup(s).