aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPaul Eggert2014-11-16 20:38:15 -0800
committerPaul Eggert2014-11-16 20:41:22 -0800
commit0921dbc3ab4dcc6b291ef45e46a24b322bbcb885 (patch)
tree0e320978c7d30af415bb7de6e0b8f6735a3ca3d1 /etc
parent058f56d24f776bdc25bcac86fe1f8969a78374e9 (diff)
downloademacs-0921dbc3ab4dcc6b291ef45e46a24b322bbcb885.tar.gz
emacs-0921dbc3ab4dcc6b291ef45e46a24b322bbcb885.zip
Improve time stamp handling, and be more consistent about it.
This implements a suggestion made in: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00587.html Among other things, this means timer.el no longer needs to autoload the time-date module. * doc/lispref/os.texi (Time of Day, Time Conversion, Time Parsing) (Processor Run Time, Time Calculations): Document the new behavior, plus be clearer about the old behavior. (Idle Timers): Take advantage of new functionality. * etc/NEWS: Document the changes. * lisp/allout-widgets.el (allout-elapsed-time-seconds): Doc fix. * lisp/arc-mode.el (archive-ar-summarize): * lisp/calendar/time-date.el (seconds-to-time, days-to-time, time-since): * lisp/emacs-lisp/timer.el (timer-relative-time, timer-event-handler) (run-at-time, with-timeout-suspend, with-timeout-unsuspend): * lisp/net/tramp.el (tramp-time-less-p, tramp-time-subtract): * lisp/proced.el (proced-time-lessp): * lisp/timezone.el (timezone-time-from-absolute): * lisp/type-break.el (type-break-schedule, type-break-time-sum): Simplify by using new functionality. * lisp/calendar/cal-dst.el (calendar-next-time-zone-transition): Do not return time values in obsolete and undocumented (HI . LO) format; use (HI LO) instead. * lisp/calendar/time-date.el (with-decoded-time-value): Treat 'nil' as current time. This is mostly for XEmacs. (encode-time-value, with-decoded-time-value): Obsolete. (time-add, time-subtract, time-less-p): Use no-op autoloads, for XEmacs. Define only if XEmacs, as they're now C builtins in Emacs. * lisp/ldefs-boot.el: Update to match new time-date.el * lisp/proced.el: Do not require time-date. * src/editfns.c (invalid_time): New function. Use it instead of 'error ("Invalid time specification")'. (time_add, time_subtract, time_arith, Ftime_add, Ftime_less_p) (decode_float_time, lisp_to_timespec, lisp_time_struct): New functions. (make_time_tail, make_time): Remove. All uses changed to use new functions or plain list4i. (disassemble_lisp_time): Return effective length if successful. Check that LOW is an integer, if it's combined with other components. (decode_time_components): Decode into struct lisp_time, not struct timespec, so that we can support a wide set of times regardless of whether time_t is signed. Decode plain numbers as seconds since the Epoch, and nil as the current time. (lisp_time_argument, lisp_seconds_argument, Ffloat_time): Reimplement in terms of new functions. (Fencode_time): Just use list2i. (syms_of_editfns): Add time-add, time-subtract, time-less-p. * src/keyboard.c (decode_timer): Don't allow the new formats (floating point or nil) in timers. * src/systime.h (LO_TIME_BITS): New constant. Use it everywhere in place of the magic number '16'. (struct lisp_time): New type. (decode_time_components): Use it. (lisp_to_timespec): New decl.
Diffstat (limited to 'etc')
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/NEWS19
2 files changed, 24 insertions, 0 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 983fcaa28eb..ed8c345eef5 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12014-11-17 Paul Eggert <eggert@cs.ucla.edu>
2
3 Improve time stamp handling, and be more consistent about it.
4 * NEWS: Document the changes.
5
12014-11-14 Lars Magne Ingebrigtsen <larsi@gnus.org> 62014-11-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 7
3 * NEWS: Mention the new `M-s M-s' keystroke. 8 * NEWS: Mention the new `M-s M-s' keystroke.
diff --git a/etc/NEWS b/etc/NEWS
index b0e08d46819..cb34e9b4613 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -377,6 +377,25 @@ optional repeat-count argument.
377*** New macros `thread-first' and `thread-last' allow threading a form 377*** New macros `thread-first' and `thread-last' allow threading a form
378 as the first or last argument of subsequent forms. 378 as the first or last argument of subsequent forms.
379 379
380+++
381** Time-related changes:
382
383*** Time-related functions now consistently accept numbers
384(representing seconds since the epoch) and nil (representing the
385current time) as well as the usual list-of-integer representation.
386Affected functions include `current-time-string', `current-time-zone',
387`decode-time', `float-time', `format-time-string', `seconds-to-time',
388`time-add', `time-less-p', `time-subtract', `time-to-day-in-year',
389`time-to-days', and `time-to-seconds'.
390
391*** The `encode-time-value' and `with-decoded-time-value' macros have
392been obsoleted.
393
394*** `calendar-next-time-zone-transition', `time-add', and
395`time-subtract' no longer return time values in the obsolete and
396undocumented integer-pair format. Instead, they return a list of two
397integers.
398
380 399
381* Changes in Frames and Windows Code in Emacs 25.1 400* Changes in Frames and Windows Code in Emacs 25.1
382 401