master 57c5967828f: current-time-list now defaults to nil
Paul Eggert <[email protected]> Fri, 24 Jul 2026 02:05:22 -0400 (EDT)
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: master commit 57c5967828f0415604a393b244bd62be93262f30 Author: Paul Eggert <[email protected]> Commit: Paul Eggert <[email protected]> current-time-list now defaults to nil Change the default value from current-time-list from t to nil. This continues the transition that was begun in Emacs 29, so that functions like current-time generate timestamps in the more-efficient and more-consistent (TICKS . HZ) form. * src/timefns.c: Default to false. --- doc/lispintro/emacs-lisp-intro.texi | 13 +++++++------ doc/lispref/files.texi | 18 +++++++++--------- doc/lispref/intro.texi | 6 +++--- doc/lispref/os.texi | 16 +++++++--------- etc/NEWS | 5 +++++ src/timefns.c | 20 ++++++++------------ 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index fc1da41af8b..cedd757555e 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -15206,12 +15206,13 @@ nil 100 @end group @group -(20615 27034 579989 697000) -(17905 55681 0 0) -(20615 26327 734791 805000)@footnote{If @code{current-time-list} is -@code{nil} the three timestamps are @code{(1351051674579989697 -. 1000000000)}, @code{(1173477761000000000 . 1000000000)}, and -@code{(1351050967734791805 . 1000000000)}, respectively.} +(1351051674579989697 . 1000000000) +(1173477761000000000 . 1000000000) +(1351050967734791805 . 1000000000)@footnote{If @code{current-time-list} is +@code{t} the three timestamps are +@code{(20615 27034 579989 697000)}, +@code{(17905 55681 0 0)}, and +@code{(20615 26327 734791 805000)}, respectively.} 13188 "-rw-r--r--" @end group diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index f86a18fd896..5c516c0b0d1 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1467,20 +1467,20 @@ is owned by the user with name @samp{lh}. @item "users" is in the group with name @samp{users}. -@item (20614 64019 50040 152000) +@item (1351023123050040152 . 1000000000) was last accessed on October 23, 2012, at 20:12:03.050040152 UTC@. -(This timestamp is @code{(1351023123050040152 . 1000000000)} -if @code{current-time-list} is @code{nil}.) +(This timestamp is @code{(20614 64019 50040 152000)} +if @code{current-time-list} is @code{t}.) -@item (20000 23 0 0) +@item (1310720023000000000 . 1000000000) was last modified on July 15, 2001, at 08:53:43.000000000 UTC@. -(This timestamp is @code{(1310720023000000000 . 1000000000)} -if @code{current-time-list} is @code{nil}.) +(This timestamp is @code{(20000 23 0 0)} +if @code{current-time-list} is @code{t}.) -@item (20614 64555 902289 872000) +@item (1351023659902289872 . 1000000000) last had its status changed on October 23, 2012, at 20:20:59.902289872 UTC@. -(This timestamp is @code{(1351023659902289872 . 1000000000)} -if @code{current-time-list} is @code{nil}.) +(This timestamp is @code{(20614 64555 902289 872000)} +if @code{current-time-list} is @code{t}.) @item 122295 is 122295 bytes long. (It may not contain 122295 characters, though, diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi index cc0cbfaf980..f73db91a379 100644 --- a/doc/lispref/intro.texi +++ b/doc/lispref/intro.texi @@ -504,11 +504,11 @@ if the information is not available. @example @group emacs-build-time - @result{} (25194 55894 8547 617000) + @result{} (1651169878008547617 . 1000000000) @end group @end example -(This timestamp is @code{(1651169878008547617 . 1000000000)} -if @code{current-time-list} was @code{nil} when Emacs was built.) +(This timestamp is @code{(25194 55894 8547 617000)} +if @code{current-time-list} was @code{t} when Emacs was built.) @end defvar @defvar emacs-version diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index fb2a481c7a3..04ca0241622 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1447,15 +1447,13 @@ The operating system limits the range of time and zone values. @end defun @defvar current-time-list -This boolean variable is a transition aid. If @code{t}, -@code{current-time} and related functions return timestamps in list -form, typically @code{(@var{high} @var{low} @var{micro} @var{pico})}; -otherwise, they use @code{(@var{ticks} . @var{hz})} form. Currently -this variable defaults to @code{t}, for behavior compatible with -previous Emacs versions. Developers are encouraged to test -timestamp-related code with this variable set to @code{nil}, as it -will default to @code{nil} in a future Emacs version, and will be -removed in some version after that. +This boolean variable is a transition aid. If @code{nil} (the default), +@code{current-time} and related functions return timestamps in +@code{(@var{ticks} . @var{hz})} form. If @code{t}, these functions +return in list form, typically @code{(@var{high} @var{low} @var{micro} +@var{pico})}, for behavior compatible with previous Emacs versions. +As it is merely a transition aid, this variable is planned to be removed +in some future Emacs version. @end defvar @defun current-time diff --git a/etc/NEWS b/etc/NEWS index 10feed8e388..6664bb18b80 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -226,6 +226,11 @@ pattern does not match its corresponding value. This can be useful for destructuring values when you do not wish to continue if the corresponding value is not as expected. ++++ +** The transition variable 'current-time-list' now defaults to nil, +so timestamps now default to (TICKS . HZ) form instead of the older +(HIGH LOW USEC PSEC) form. + * Lisp Changes in Emacs 32.1 diff --git a/src/timefns.c b/src/timefns.c index 88f5504fe35..f3471a3ce1a 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -66,11 +66,9 @@ enum { TM_YEAR_BASE = 1900 }; # define FASTER_TIMEFNS 1 #endif -/* current-time-list defaults to t, typically generating (HI LO US PS) - timestamps. To change the default to nil, generating (TICKS . HZ) - timestamps, compile with -DCURRENT_TIME_LIST=0. */ +/* current-time-list defaults to nil, generating (TICKS . HZ) timestamps. */ #ifndef CURRENT_TIME_LIST -enum { CURRENT_TIME_LIST = true }; +enum { CURRENT_TIME_LIST = false }; #endif #if FASTER_TIMEFNS && !FIXNUM_OVERFLOW_P (1000000000) @@ -2112,14 +2110,12 @@ syms_of_timefns (void) DEFVAR_BOOL ("current-time-list", current_time_list, doc: /* Whether `current-time' should return list or (TICKS . HZ) form. -This boolean variable is a transition aid. If t, `current-time' and -related functions return timestamps in list form, typically -\(HIGH LOW USEC PSEC); otherwise, they use (TICKS . HZ) form. -Currently this variable defaults to t, for behavior compatible with -previous Emacs versions. Developers are encouraged to test -timestamp-related code with this variable set to nil, as it will -default to nil in a future Emacs version, and will be removed in some -version after that. */); +This boolean variable is a transition aid. If nil (the default), +`current-time' and related functions return timestamps in (TICKS . HZ) +form. If t, these functions return in list form, typically (HIGH LOW +USEC PSEC), for behavior compatible with previous Emacs versions. As it +is merely a transition aid, this variable is planned to be removed in +some future Emacs version. */); current_time_list = CURRENT_TIME_LIST; defsubr (&Scurrent_time);