[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why doesn't Emacs have an `active-timer-p' command, or why can't I f
From: |
Óscar Fuentes |
Subject: |
Re: Why doesn't Emacs have an `active-timer-p' command, or why can't I find it? |
Date: |
Thu, 11 Nov 2021 22:24:47 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Alan Mackenzie <acm@muc.de> writes:
> Hello, Eli.
>
> On Thu, Nov 11, 2021 at 22:37:43 +0200, Eli Zaretskii wrote:
>> > Date: Thu, 11 Nov 2021 20:31:24 +0000
>> > From: Alan Mackenzie <acm@muc.de>
>
>> > There doesn't appear to be an easy way in a Lisp program to determine if
>> > a timer object is active.
>
>> What is an "active timer", and how does it differ from a non-active
>> one?
>
> An active timer is one which will trigger its timer function at the
> appropriate time.
>
> A non-active timer is one which will not trigger any timer function -
> for example, a non-repeating timer which has already triggered.
>
> timerp returns t for both of these objects.
Following the implicit definition on the docstring of `cancel-timer', an
active timer is a timer object contained in the list of active timers
(actually, either in `timer-list' or in `timer-idle-list'.)
An implementation would be
(defun timer-active-p (timer)
(timer--check timer)
(or (memq timer timer-list))
(memq timer timer-idle-list))
- Why doesn't Emacs have an `active-timer-p' command, or why can't I find it?, Alan Mackenzie, 2021/11/11
- Re: Why doesn't Emacs have an `active-timer-p' command, or why can't I find it?, Eli Zaretskii, 2021/11/11
- Re: Why doesn't Emacs have an `active-timer-p' command, or why can't I find it?, Alan Mackenzie, 2021/11/11
- Re: Why doesn't Emacs have an `active-timer-p' command, or why can't I find it?,
Óscar Fuentes <=
- Re: Why doesn't Emacs have an `active-timer-p' command, or why can't I find it?, Lars Ingebrigtsen, 2021/11/11
- ๊Unsubscribe, Sakesun Roykiattisak, 2021/11/12
- Re: Why doesn't Emacs have an `active-timer-p' command, or why can't I find it?, Rudolf Schlatte, 2021/11/12
- Re: Why doesn't Emacs have an `active-timer-p' command, or why can't I find it?, Filipp Gunbin, 2021/11/12