Subject: bug#37875: 27.0.50; `run-with-timer' not documented in (elisp)Timers

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 28 Oct 2019 16:55:02 +0100

Michael Heerdegen <[email-masked]> writes:

> Phil Sainty <[email-masked]> writes:
>
>> I just noticed that `run-with-timer' is not mentioned anywhere
>> in the elisp manual.
>>
>> (elisp)Timers even mentions `run-with-idle-timer', which also has
>> its own node at (elisp)Idle Timers; however `run-with-timer' is
>> not pointed out.
>
> It mentions `run-at-time' which is ... quite the same?  I share your
> confusion: seems the commands `run-at-time' and `run-with-timer' can be
> merged and one can be made an alias for the other.

The definition is:

(defun run-with-timer (secs repeat function &rest args)
[...]
  (apply 'run-at-time secs repeat function args))

So that's a kinda strange function to have?

It's used about 50 places in the in-tree code; run-at-time is used about
80 places.  run-at-time has a better name, I think, but run-with-timer
has a name that's analogous to run-with-idle-timer.

Does anybody know why run-with-timer was added?  I think we should
obsolete one or the other, and I think run-at-time has the best name.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no