emacs/lisp/emacs-lisp
Paul Eggert 89c63b3522 New function time-convert
This replaces the awkward reuse of encode-time to both convert
calendrical timestamps to Lisp timestamps, and to convert Lisp
timestamps to other forms.  Now, encode-time does just the
former and the new function does just the latter.
The new function builds on a suggestion by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00801.html
and refined by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00803.html
* doc/lispref/os.texi (Time of Day, Time Conversion):
* doc/misc/emacs-mime.texi (time-date):
* etc/NEWS: Update documentation.
* lisp/calendar/cal-dst.el (calendar-next-time-zone-transition):
* lisp/calendar/time-date.el (seconds-to-time, days-to-time):
* lisp/calendar/timeclock.el (timeclock-seconds-to-time):
* lisp/cedet/ede/detect.el (ede-detect-qtest):
* lisp/completion.el (cmpl-hours-since-origin):
* lisp/ecomplete.el (ecomplete-add-item):
* lisp/emacs-lisp/cl-extra.el (cl--random-time):
* lisp/emacs-lisp/timer.el (timer--time-setter)
(timer-next-integral-multiple-of-time):
* lisp/find-lisp.el (find-lisp-format-time):
* lisp/gnus/gnus-diary.el (gnus-user-format-function-d):
* lisp/gnus/gnus-group.el (gnus-group-set-timestamp):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-show-org-agenda):
* lisp/gnus/nnrss.el (nnrss-normalize-date):
* lisp/gnus/nnspool.el (nnspool-request-newgroups):
* lisp/net/ntlm.el (ntlm-compute-timestamp):
* lisp/net/pop3.el (pop3-uidl-dele):
* lisp/obsolete/vc-arch.el (vc-arch-add-tagline):
* lisp/org/org-clock.el (org-clock-get-clocked-time)
(org-clock-resolve, org-resolve-clocks, org-clock-in)
(org-clock-out, org-clock-sum):
* lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36):
* lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
* lisp/proced.el (proced-format-time):
* lisp/progmodes/cc-cmds.el (c-progress-init)
(c-progress-update):
* lisp/progmodes/cperl-mode.el (cperl-time-fontification):
* lisp/progmodes/flymake.el (flymake--schedule-timer-maybe):
* lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info)
(vhdl-fix-case-region-1):
* lisp/tar-mode.el (tar-octal-time):
* lisp/time.el (emacs-uptime):
* lisp/url/url-auth.el (url-digest-auth-make-cnonce):
* lisp/url/url-util.el (url-lazy-message):
* lisp/vc/vc-cvs.el (vc-cvs-parse-entry):
* lisp/vc/vc-hg.el (vc-hg-state-fast):
* lisp/xt-mouse.el (xterm-mouse-event):
* test/lisp/emacs-lisp/timer-tests.el:
(timer-next-integral-multiple-of-time-2):
Use time-convert, not encode-time.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
Don’t use now-removed FORM argument for encode-time.
It wasn’t crucial anyway.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add time-convert.
* lisp/emacs-lisp/elint.el (elint-unknown-builtin-args):
Update encode-time signature to match current arg set.
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Use timer-convert with t rather than doing it by hand.
* src/timefns.c (time_hz_ticks, time_form_stamp, lisp_time_form_stamp):
Remove; no longer needed.
(decode_lisp_time): Rturn the form instead of having a *PFORM arg.
All uses changed.
(time_arith): Just return TICKS if HZ is 1.
(Fencode_time): Remove argument FORM.  All callers changed.
Do not attempt to encode time values; just encode
decoded (calendrical) times.
Unless CURRENT_TIME_LIST, just return VALUE since HZ is 1.
(Ftime_convert): New function, which does the time value
conversion that bleeding-edge encode-time formerly did.
Return TIME if it is easy to see that it is already
of the correct form.
(Fcurrent_time): Mention in doc that the form is planned to change.
* test/src/timefns-tests.el (decode-then-encode-time):
Don’t use (encode-time nil).
2019-08-05 18:37:29 -07:00
..
advice.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
autoload.el * lisp/emacs-lisp/autoload.el: Make progress info more informative. 2019-07-27 17:53:46 -04:00
avl-tree.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
backquote.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
backtrace.el Update more copyright years 2018-12-31 18:47:22 -08:00
benchmark.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
bindat.el Fix byte compilation warning in bindat.el 2019-06-15 16:33:20 +02:00
byte-opt.el New function time-convert 2019-08-05 18:37:29 -07:00
byte-run.el (with-suppressed-warnings): Also suppress warnings when not byte-compiling 2019-06-22 23:29:00 -04:00
bytecomp.el Document batch-byte-compile directory behavior 2019-08-01 23:16:37 +02:00
cconv.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
chart.el Fix usage of remove-text-properties 2019-08-01 17:04:53 +03:00
check-declare.el Make check-declare understand cl-defun 2019-07-13 16:49:23 +02:00
checkdoc.el Checkdoc would bug out on empty files 2019-07-09 18:45:18 +02:00
cl-extra.el New function time-convert 2019-08-05 18:37:29 -07:00
cl-generic.el Make with-suppressed-warnings work in cl-defmethod 2019-06-17 11:39:56 +02:00
cl-indent.el Fix for lisp tagbody indentation 2019-07-09 15:51:50 +02:00
cl-lib.el Make cl-values-list signal an error if its argument isn't a list 2019-07-28 14:14:46 +02:00
cl-macs.el * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add slot option :documentation 2019-07-29 11:56:11 -04:00
cl-preloaded.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
cl-print.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
cl-seq.el * lisp/emacs-lisp/bytecomp.el (byte-compile-dynamic): Mark obsolete 2019-06-21 10:30:50 -04:00
cl.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
copyright.el Omit/rewrite useless regexp repetitions 2019-04-12 19:43:41 -07:00
crm.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
cursor-sensor.el * lisp/emacs-lisp/cursor-sensor.el: Fix sensor behavior with overlays 2019-03-08 17:20:58 -05:00
debug.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
derived.el ; * lisp/emacs-lisp/derived.el (define-derived-mode): Doc fix. 2019-07-28 17:31:17 +03:00
disass.el Compilation fix for previous change 2019-06-13 13:56:16 +02:00
easy-mmode.el * easy-mmode.el: simplify via custom-current-group 2019-03-26 11:45:07 -04:00
easymenu.el easy-menu-define doc string fix 2019-08-03 20:32:24 +02:00
edebug.el edebug.el comment fix 2019-07-27 13:34:17 +02:00
eieio-base.el Move around defgeneric/defmethods in eieio 2019-06-19 17:12:29 +02:00
eieio-compat.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
eieio-core.el Change the eieio-declare-slots function into a macro 2019-06-17 15:48:39 +02:00
eieio-custom.el Clean up eieio-custom slightly 2019-06-20 12:51:39 +02:00
eieio-datadebug.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
eieio-opt.el Add comment to eieio-opt about why we're requiring cl-extra 2019-06-16 22:26:40 +02:00
eieio-speedbar.el Fix regular-expression glitches and typos 2019-03-04 18:00:58 -08:00
eieio.el Move around defgeneric/defmethods in eieio 2019-06-19 17:12:29 +02:00
eldoc.el Remove Maintainer: when it duplicates Author: 2019-05-26 01:00:15 -07:00
elint.el New function time-convert 2019-08-05 18:37:29 -07:00
elp.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
ert-x.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
ert.el Fix ‘make check’ failure 2019-07-26 09:41:55 -07:00
ewoc.el Fixes for "Maintainer:" and related lines 2019-05-19 21:34:27 -07:00
faceup.el Update more copyright years 2018-12-31 18:47:22 -08:00
find-func.el Remove Maintainer: when it duplicates Author: 2019-05-26 01:00:15 -07:00
float-sup.el Suppress warning about pi not having a prefix 2019-06-12 17:46:06 +02:00
generator.el * lisp/subr.el (prog2): Define as a macro 2019-04-02 10:04:44 -04:00
generic.el Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo" 2019-06-26 10:24:59 -04:00
gv.el Tweak gv-define-setter debug setting 2019-07-15 11:16:37 +02:00
helper.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
inline.el Fix inline-quote Edebug spec 2019-07-21 15:40:48 +02:00
let-alist.el * lisp/emacs-lisp/let-alist.el: Bump version to 1.0.6 (Bug#23244). 2019-07-30 21:13:36 -04:00
lisp-mnt.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
lisp-mode.el Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo" 2019-06-26 10:24:59 -04:00
lisp.el (beginning-of-defun-raw): Suppress warning about syntax-begin-function 2019-06-12 17:46:06 +02:00
macroexp.el Clarify macroexp-let* doc string 2019-08-04 14:43:43 +02:00
map-ynp.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
map.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
nadvice.el Tweak output of doc in advice--make-docstring 2019-07-13 17:48:53 +02:00
package-x.el Merge from origin/emacs-26 2019-07-30 21:42:34 -07:00
package.el Make URLs in package descriptions into links 2019-07-28 16:01:45 +02:00
pcase.el Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo" 2019-06-26 10:24:59 -04:00
pp.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
radix-tree.el * lisp/emacs-lisp/radix-tree.el (pcase-defmacro): Improve docstring 2019-04-19 23:31:59 -04:00
re-builder.el Tweak messaging in re-builder 2019-07-09 03:44:13 +02:00
regexp-opt.el Optimise more inputs to `regexp-opt' (bug#36444) 2019-07-04 17:18:15 +02:00
regi.el Remove Maintainer: when it duplicates Author: 2019-05-26 01:00:15 -07:00
ring.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
rmc.el Avoid infloop in read-multiple-choice (Bug#32257) 2019-05-26 08:46:30 -04:00
rx.el Shorter `rx' doc string (bug#36496) 2019-07-07 11:49:22 +02:00
seq.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
shadow.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
smie.el Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo" 2019-06-26 10:24:59 -04:00
subr-x.el (if-let): Improve docstring by mentioning let* 2019-06-23 22:55:40 +02:00
syntax.el Document syntax-ppss-context 2019-06-24 00:04:04 +02:00
tabulated-list.el Move widen/narrow in tabulated lists to } and { 2019-06-25 22:34:55 +02:00
tcover-ses.el Remove Maintainer: when it duplicates Author: 2019-05-26 01:00:15 -07:00
tcover-unsafep.el Remove Maintainer: when it duplicates Author: 2019-05-26 01:00:15 -07:00
testcover.el Fix testcover.el usage of edebug.el symbols 2019-07-28 11:39:22 +02:00
text-property-search.el Update more copyright years 2018-12-31 18:47:22 -08:00
thunk.el * lisp/emacs-lisp/thunk.el (thunk-delay): Fix memory leak 2019-06-04 12:55:53 -04:00
timer-list.el Escape newlines when printing functions in timer list 2019-06-13 14:11:39 +02:00
timer.el New function time-convert 2019-08-05 18:37:29 -07:00
tq.el Tweak tq queue processing 2019-08-03 16:33:06 +02:00
trace.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
unsafep.el Remove Maintainer: when it duplicates Author: 2019-05-26 01:00:15 -07:00
warnings.el Don't hard-code the fill-column for display-warning 2019-06-16 17:37:21 -07:00