1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-27 10:21:14 -08:00
emacs/lisp/vc
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
..
add-log.el Improved ChangeLog generation for vc log (Bug#16301) 2019-08-03 20:14:52 -04:00
compare-w.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
cvs-status.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
diff-mode.el Improved ChangeLog generation for vc log (Bug#16301) 2019-08-03 20:14:52 -04:00
diff.el Check labels in smerge-mode 2019-06-25 23:23:01 +02:00
ediff-diff.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff-help.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff-hook.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff-init.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff-merg.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff-mult.el Use decoded time accessors in ediff-mult 2019-07-30 13:11:38 +02:00
ediff-ptch.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff-util.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff-vers.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff-wind.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
ediff.el * lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup 2019-06-21 01:16:54 -04:00
emerge.el * lisp/vc/emerge.el: Use lexical-binding 2018-04-03 23:17:30 -04:00
log-edit.el Improved ChangeLog generation for vc log (Bug#16301) 2019-08-03 20:14:52 -04:00
log-view.el ; Revert "Publicize behavior of log-view-diff at beginning/end of active region" 2019-06-10 03:58:53 +03:00
pcvs-defs.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
pcvs-info.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
pcvs-parse.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
pcvs-util.el * lisp/emacs-lisp/bytecomp.el (byte-compile-dynamic): Mark obsolete 2019-06-21 10:30:50 -04:00
pcvs.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
smerge-mode.el Check labels in smerge-mode 2019-06-25 23:23:01 +02:00
vc-annotate.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
vc-bzr.el Include the date in the bzr annotation buffer 2019-06-27 21:00:36 +02:00
vc-cvs.el New function time-convert 2019-08-05 18:37:29 -07:00
vc-dav.el Remove Maintainer: when it duplicates Author: 2019-05-26 01:00:15 -07:00
vc-dir.el * lisp/vc/vc-dir.el (vc-dir-search): Remove lambda. 2019-07-16 01:12:12 +03:00
vc-dispatcher.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
vc-filewise.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
vc-git.el * lisp/vc/vc.el (vc-log-search): Fix docstring (bug#36644). 2019-07-25 02:21:28 +03:00
vc-hg.el New function time-convert 2019-08-05 18:37:29 -07:00
vc-hooks.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
vc-mtn.el Add standard unmatchable regexp 2019-05-15 18:55:27 +02:00
vc-rcs.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
vc-sccs.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
vc-src.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
vc-svn.el Improve regexp advice again, and unchain ranges 2019-04-02 15:01:34 -07:00
vc.el * lisp/vc/vc.el (vc-log-search): Fix docstring (bug#36644). 2019-07-25 02:21:28 +03:00