From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: master d378615: Cancel timer when world-clock buffer is killed
Date: Sun, 06 Sep 2020 16:55:27 +0100 [thread overview]
Message-ID: <87zh62sxw0.fsf@tcd.ie> (raw)
In-Reply-To: <CADwFkmnUR198UfNOteFtjZpoo0qZjsmPHF5j8rG3Mhoc8chKHQ@mail.gmail.com> (Stefan Kangas's message of "Sun, 6 Sep 2020 15:38:10 +0000")
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?
Thanks,
--
Basil
prev parent reply other threads:[~2020-09-06 15:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200903105449.22858.36474@vcs0.savannah.gnu.org>
[not found] ` <20200903105450.8CD2D20A15@vcs0.savannah.gnu.org>
2020-09-03 13:46 ` master d378615: Cancel timer when world-clock buffer is killed Basil L. Contovounesios
2020-09-03 17:22 ` Stefan Kangas
2020-09-04 9:58 ` Basil L. Contovounesios
2020-09-06 15:38 ` Stefan Kangas
2020-09-06 15:55 ` Basil L. Contovounesios [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zh62sxw0.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=emacs-devel@gnu.org \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.