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: Stefan Monnier
Subject: Re: Should `cancel-timer' use `delete' instead of `delq'?
Date: Tue, 05 Sep 2006 11:38:50 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> 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'.


        Stefan




reply via email to

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