unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: Lars Ingebrigtsen <larsi@gnus.org>, Eli Zaretskii <eliz@gnu.org>
Cc: michael_heerdegen@web.de, 37875@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	[thread overview]
Message-ID: <2d52039c-5ba3-0ac5-b514-8e3bf00a6aad@orcon.net.nz> (raw)
In-Reply-To: <87wocn23y1.fsf@gnus.org>

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





  reply	other threads:[~2019-10-29 11:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22 18:38 bug#37875: 27.0.50; `run-with-timer' not documented in (elisp)Timers Phil Sainty
2019-10-23  7:01 ` Michael Heerdegen
2019-10-28 15:55   ` Lars Ingebrigtsen
2019-10-28 17:00     ` Eli Zaretskii
2019-10-29 11:20       ` Lars Ingebrigtsen
2019-10-29 11:34         ` Phil Sainty [this message]
2019-10-29 12:31         ` Eli Zaretskii
2019-10-29 12:37           ` Lars Ingebrigtsen
2019-10-29 12:41             ` Eli Zaretskii
2019-10-29 21:22               ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d52039c-5ba3-0ac5-b514-8e3bf00a6aad@orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=37875@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).