From 20788126a0fc572f8e2939261cf56a73c96e3d2a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Dec 2024 12:30:44 +0200 Subject: [PATCH] ; Fix last change * doc/lispref/os.texi (Time Calculations): Extend documentation of 'seconds-to-string'; add missing @end defun. (Bug#71572) (cherry picked from commit b6852b67b0d462c7ba0012e5ac3b79a245f4b7e5) --- doc/lispref/os.texi | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 14bdb3c56e2..852f9f18204 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2190,10 +2190,26 @@ structure. For instance, the 120th day in 2004 is April 29th. @end defun @defun seconds-to-string delay &optional readable abbrev precision -Return a string describing a given @var{delay} (in seconds). Optional -arguments can be used to configure a human readable delay using various -formats. For example, a delay of 9861.5 seconds with @var{readable} set -to the symbol @code{expanded} returns @samp{2 hours 44 minutes}. +Return a string describing a given @var{delay} (in seconds). By +default, this function formats the returned string as a floating-point +number in units selected according to the value of @var{delay}. For +example, a delay of 9861.5 seconds yields @samp{2.74h}, since the value +of @var{delay} is longer than 1 hour, but shorter than 1 day. The +output formatting can be further controlled by the optional arguments, +if optional argument @var{readable} is non-@code{nil}. If +@var{readable}'s value is @code{expanded}, the returned string will +describe @var{delay} using two units; for example, a delay of 9861.5 +seconds with @var{readable} set to the symbol @code{expanded} returns +@samp{2 hours 44 minutes}, but if @var{readable} is @code{t}, the +function returns @samp{3 hours}. Optional argument @var{abbrev}, if +non-@code{nil}, means to abbreviate the units: use @samp{h} instead of +@samp{hours}, @samp{m} instead of @samp{minutes}, etc. If +@var{precision} is a whole integer number, the function rounds the value +of the smallest unit it produces to that many digits after the decimal +point; thus, 9861.5 with @var{precision} set to 3 yields @samp{2.739 +hours}. If @var{precision} is a non-negative float smaller than 1, the +function rounds to that value. +@end defun @node Timers @section Timers for Delayed Execution -- 2.39.5