emacs-devel
[Top][All Lists]
Advanced

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

Re: Should `cancel-timer' use `delete' instead of `delq'?


From: David Kastrup
Subject: Re: Should `cancel-timer' use `delete' instead of `delq'?
Date: Tue, 05 Sep 2006 23:56:19 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> It's almost certainly intentional that it uses delq.  A timer is a
>> unique entity.
>
>> If application code can create multiple timers and doesn't save all the
>> corresponding cookies for deletion, it's obviously a bug in that
>> application code.
>
> While I somewhat agree with Miles, I also agree with Drew that it
> can lead to undesirable situations where it's very difficult to
> return to a "normal" session, other than by restarting Emacs.
>
> I've been tempted to change timer-idle-list and timer-list so that
> they use weak-pointers.  I.e. if you don't hold on to your timer by
> storing it in a global var or somesuch, then it'll get
> cancelled/destroyed at the next GC.  I think this could work if we
> only do it for timers that use `repeat'.

Does not sound too hot to me: after all, garbage collection happens
nondeterministically, and there are valid cases for repetitive timers
that will never need to be cancelled (a running clock somewhere, or a
yearly birthday reminder...).  It would surprise the user if his
timers suddenly stopped without reason when they ran perfectly well
for a while.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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