GNU bug report logs - #37875
27.0.50; `run-with-timer' not documented in (elisp)Timers

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Tue, 22 Oct 2019 18:39:01 UTC

Severity: minor

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, 37875 <at> debbugs.gnu.org
Subject: bug#37875: 27.0.50; `run-with-timer' not documented in (elisp)Timers
Date: Wed, 30 Oct 2019 00:34:33 +1300
On 30/10/19 12:20 AM, Lars Ingebrigtsen wrote:
> Not really -- I wondered why there were two functions (run-with-timer
> and run-at-time) that are identical.
> 
> It could be made into a defalias at least -- the run-at-time doc string
> is much better than the run-with-timer one.

I think the point is this:

(run-with-idle-timer SECS REPEAT FUNCTION &rest ARGS)
(run-with-timer      SECS REPEAT FUNCTION &rest ARGS)
(run-at-time         TIME REPEAT FUNCTION &rest ARGS)

`run-with-timer' is the non-idle analog of `run-with-idle-timer',
with a documented expectation that one passes it a number of
seconds as its first argument SECS, being the timeout to use.

So if I see either `run-with-timer' or `run-with-idle-timer' then
I know I'm looking at a timeout argument in seconds.

`run-with-time' has a different argument, TIME, which *may* be a
number of seconds (and therefore `run-with-timer' can be defined
in terms of this); but ostensibly it's a more general function.

I'd argue for keeping them both.  If anything, I'd be inclined to
add validation to `run-with-timer' to check that an integer was
passed.


-Phil




This bug report was last modified 5 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.