Mercurial > emacs
changeset 79198:d2c45585a2f5
(Idle Timers): current-idle-time returns nil if not idle.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 24 Oct 2007 08:18:34 +0000 |
parents | 05ea1c83f761 |
children | dc41f20bdc91 |
files | lispref/os.texi |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lispref/os.texi Wed Oct 24 08:17:47 2007 +0000 +++ b/lispref/os.texi Wed Oct 24 08:18:34 2007 +0000 @@ -1556,10 +1556,10 @@ @c Emacs 19 feature @defun current-idle-time -This function returns the length of time Emacs has been idle, as a -list of three integers: @code{(@var{high} @var{low} @var{microsec})}. -The integers @var{high} and @var{low} combine to give the number of -seconds of idleness, which is +If Emacs is idle, this function returns the length of time Emacs has +been idle, as a list of three integers: @code{(@var{high} @var{low} +@var{microsec})}. The integers @var{high} and @var{low} combine to +give the number of seconds of idleness, which is @ifnottex @var{high} * 2**16 + @var{low}. @end ifnottex @@ -1571,6 +1571,9 @@ start of the current second (or 0 for systems that return time with the resolution of only one second). +When Emacs is not idle, @code{current-idle-time} returns @code{nil}. +This is a convenient way to test whether Emacs is idle. + The main use of this function is when an idle timer function wants to ``take a break'' for a while. It can set up another idle timer to call the same function again, after a few seconds more idleness.