1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-07 15:00:34 -08:00
emacs/test/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
..
edebug-resources Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
eieio-tests Merge from origin/emacs-26 2019-06-01 12:04:42 -07:00
faceup-resources Update more copyright years 2018-12-31 18:47:22 -08:00
faceup-tests Update more copyright years 2018-12-31 18:47:22 -08:00
package-resources
shadow-resources Handle case-insensitive filenames for load-path shadows (Bug#5845) 2018-01-18 16:26:52 -05:00
testcover-resources `unknown' test case now works 2019-07-28 11:40:30 +02:00
backtrace-tests.el Update more copyright years 2018-12-31 18:47:22 -08:00
benchmark-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
bindat-tests.el Also test unpacking 2019-06-15 16:10:28 +02:00
bytecomp-tests.el Conditionalize result of a bytecomp test 2019-07-09 03:27:26 -07:00
cconv-tests.el Update more copyright years 2018-12-31 18:47:22 -08:00
checkdoc-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
cl-extra-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
cl-generic-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
cl-lib-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
cl-macs-tests.el * cl-macs-tests.el (cl-macs-test--symbol-macrolet): New test 2019-05-16 17:16:36 -04:00
cl-preloaded-tests.el Update more copyright years 2018-12-31 18:47:22 -08:00
cl-print-tests.el Fix some ineffective backslashes in string literals 2019-03-16 11:38:58 -07:00
cl-seq-tests.el Fix cl-member' and cl-assoc' for bignums 2019-06-01 18:13:00 -07:00
cl-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
derived-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
edebug-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
ert-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
ert-x-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
generator-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
gv-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
let-alist-tests.el Make let-alist work with vectors 2019-07-28 23:28:24 +02:00
lisp-mode-tests.el Be more careful about indent-sexp going over eol (Bug#35286) 2019-04-22 12:49:36 -04:00
lisp-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
map-tests.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
nadvice-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
package-tests.el * test/lisp/emacs-lisp/package-tests.el: Allow extra extras 2019-02-10 18:12:05 -05:00
pcase-tests.el Tighter pcase or-pattern member function selection (bug#36139) 2019-06-19 11:20:58 +02:00
pp-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
regexp-opt-tests.el Optimise more inputs to `regexp-opt' (bug#36444) 2019-07-04 17:18:15 +02:00
ring-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
rmc-tests.el ; Fix read-multiple-choice test 2019-05-26 21:55:00 -04:00
rx-tests.el Fix (rx-to-string (and (literal STR) (regexp STR)) regression 2019-06-26 08:50:27 -04:00
seq-tests.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
shadow-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
subr-x-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
tabulated-list-test.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
testcover-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
text-property-search-tests.el Add tests for text-property-search to check prop-match-value 2019-07-06 16:27:05 +02:00
thunk-tests.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
timer-tests.el New function time-convert 2019-08-05 18:37:29 -07:00