[Top][All Lists]

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

Re: master d378615: Cancel timer when world-clock buffer is killed

From: Basil L. Contovounesios
Subject: Re: master d378615: Cancel timer when world-clock buffer is killed
Date: Sun, 06 Sep 2020 16:55:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Kangas <stefankangas@gmail.com> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>> Why not keep the (internal) variable and pass it to cancel-timer
>> directly instead of searching through timer-list for a particular entry?
> Thanks for your attention to detail.
> It's a matter of taste, I suppose.  While mucking around with this, I
> saw two timers at one point, so I just kept that code as is.  (Although
> the particular issue causing two timers should be fixed now.)
> Perhaps this should just use `cancel-function-timers' though...
> Are there any strong reasons why keeping it in a variable is better?
> Maybe we just prefer that style?

I think it's the cleanest and least surprising approach.  Matching based
on function symbol (via cancel-function-timers) or name (as in the
current world-clock-cancel-timer) runs the risk of cancelling something
we didn't add.  If we want to cancel a timer that we added, we should
keep track of what we added, and explicitly cancel only that; at least
that's what my idea of common sense dictates.  Unless there's some
benefit to the other approaches I'm not seeing?



reply via email to

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