unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "T.V Raman" <raman@google.com>
To: emacs-devel@gnu.org
Subject: run-with-idle-timer Doc string Question
Date: Fri, 21 Aug 2020 10:06:39 -0700 (PDT)	[thread overview]
Message-ID: <20200821170639.17BFAC21316@raman-glaptop.localdomain> (raw)

What does this line:
Using
SECS <= N is not recommended if this function is invoked from an idle
timer, because FUNCTION will then be called immediately.

in the doc-string for run-with-idle-timer mean?

run-with-idle-timer is an interactive compiled Lisp function in
‘timer.el’.

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

  Probably introduced at or before Emacs version 19.31.

Perform an action the next time Emacs is idle for SECS seconds.
The action is to call FUNCTION with arguments ARGS.
SECS may be an integer, a floating point number, or the internal
time format returned by, e.g., ‘current-idle-time’.
If Emacs is currently idle, and has been idle for N seconds (N < SECS),
then it will call FUNCTION in SECS - N seconds from now.  Using
SECS <= N is not recommended if this function is invoked from an idle
timer, because FUNCTION will then be called immediately.

If REPEAT is non-nil, do the action each time Emacs has been idle for
exactly SECS seconds (that is, only once for each time Emacs becomes idle).

This function returns a timer object which you can use in ‘cancel-timer’.

[back]


-- 
♉Id: kg:/m/0285kf1  🦮♉

-- 
♉Id: kg:/m/0285kf1  🦮♉



             reply	other threads:[~2020-08-21 17:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 17:06 T.V Raman [this message]
2020-08-21 19:06 ` run-with-idle-timer Doc string Question Eli Zaretskii
2020-08-21 19:46   ` T.V Raman
2020-08-21 19:49     ` Eli Zaretskii
2020-08-21 20:49       ` Narendra Joshi
2020-08-21 21:23         ` Drew Adams
2020-08-22 11:05           ` Narendra Joshi

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=20200821170639.17BFAC21316@raman-glaptop.localdomain \
    --to=raman@google.com \
    --cc=emacs-devel@gnu.org \
    /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).