1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
emacs/test/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
..
bookmark-resources Add tests for bookmark.el (Bug#36452) 2019-07-03 14:49:38 +03:00
calc Fix calc number formatting with digit grouping (bug#36689) 2019-07-16 17:37:46 +02:00
calendar Port standard-test-interval to Los Angeles 2019-08-01 15:47:15 -07:00
custom-resources New test custom--test-theme-variables 2019-01-10 13:27:34 +01:00
emacs-lisp New function time-convert 2019-08-05 18:37:29 -07:00
emulation Update copyright year to 2019 2019-01-01 01:01:13 +00:00
erc Update copyright year to 2019 2019-01-01 01:01:13 +00:00
eshell Update more copyright years 2018-12-31 18:47:22 -08:00
gnus Use iso8601-parse in nnrss 2019-07-31 21:47:29 +02:00
image Make gravatar.el more configurable 2019-08-02 16:33:30 +03:00
international * lisp/international/mule-cmds.el (encode-coding-char): Fix ASCII case 2019-05-28 19:33:20 -04:00
mail Fix breaking of rfc2047 headers with long words 2019-07-12 15:59:27 +02:00
net Improve Tramp's caching 2019-08-05 13:09:26 +02:00
nxml Keep nxml prolog updated via syntax-propertize 2019-06-05 20:30:23 -04:00
org Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
play Use lexical-binding in morse.el and studly.el and add tests 2019-06-01 18:52:22 -07:00
progmodes ; Re-enable all Flymake tests on Hydra 2019-07-30 16:59:59 +03:00
so-long-tests Add tests for so-long.el 2019-07-13 18:51:55 +12:00
term Move tty-colors-tests.el to its proper directory. 2019-07-27 14:10:20 +03:00
textmodes Merge from emacs-26 2019-06-25 22:04:13 -04:00
url Merge from origin/emacs-26 2019-07-06 12:51:30 -07:00
vc Improved ChangeLog generation for vc log (Bug#16301) 2019-08-03 20:14:52 -04:00
abbrev-tests.el Fix defining inverse abbrevs on previous words (Bug#36243) 2019-06-22 19:25:44 -04:00
arc-mode-tests.el * lisp/tar-mode.el (tar-extract): Call tar--try-jka-compr (bug#34251) 2019-02-03 23:00:29 +02:00
auth-source-pass-tests.el Refactoring of auth-source-pass 2019-06-24 09:15:41 +02:00
auth-source-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
autoinsert-tests.el Use lexical-binding in autoinsert.el and add tests 2019-05-31 19:07:48 +02:00
autorevert-tests.el Tag remote autorevert tests as unstable 2019-06-15 11:08:05 +02:00
bookmark-tests.el Restore focus to Bookmark List after editing annotation 2019-07-14 09:26:42 +03:00
buff-menu-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
button-tests.el Distinguish buttons from widgets (bug#34506) 2019-04-07 03:56:27 +01:00
char-fold-tests.el * lisp/char-fold.el: Rename char-fold-make-table to char-fold--make-table. 2019-07-29 01:55:34 +03:00
color-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
comint-tests.el Add "pin" to password-word-equivalents (Bug#35523) 2019-06-06 19:29:42 -04:00
custom-tests.el New test custom--test-theme-variables 2019-01-10 13:27:34 +01:00
dabbrev-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
delim-col-tests.el Use lexical-binding in delim-col.el and add tests 2019-05-20 15:29:26 +01:00
descr-text-tests.el Update author/maintainer info 2019-05-26 01:00:16 -07:00
dired-aux-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
dired-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
dired-x-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
dom-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
electric-tests.el An electric test is now passing 2019-07-16 16:04:54 -07:00
epg-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
faces-tests.el Fix bug with face-id after restoring from pdump 2019-01-28 17:24:04 +02:00
ffap-tests.el Update a ffap test 2019-07-14 13:28:54 -07:00
filenotify-tests.el ; Fix typo in filenotify-tests.el 2019-08-02 20:13:44 +02:00
files-tests.el Clean up file-size-function 2019-08-02 12:38:44 +02:00
files-x-tests.el Do not hardcode "/bin/sh" in compile. Bug#24338, Bug#29723 2019-03-09 16:44:24 +01:00
font-lock-tests.el Stop splicing anonymous faces in font-lock-append-text-property 2019-05-13 20:41:02 -04:00
format-spec-tests.el Document format-spec and expand the modifiers it supports 2019-07-13 03:50:50 +02:00
help-fns-tests.el Use lexical-binding in help-fns-tests.el (Bug#36585) 2019-07-18 20:06:27 -04:00
hi-lock-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
htmlfontify-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
ibuffer-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
ido-tests.el Add a new user option 'ido-big-directories'. 2019-04-19 10:31:02 +02:00
image-file-tests.el Replace use of obsolete string-make-unibyte 2019-04-28 16:45:13 -04:00
image-tests.el Allow counter-clockwise rotations in image-rotate 2019-07-20 16:00:31 +01:00
imenu-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
info-xref-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
isearch-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
jit-lock-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
json-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
jsonrpc-tests.el Remove Maintainer: when it duplicates Author: 2019-05-26 01:00:15 -07:00
kmacro-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
ls-lisp-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
makesum-tests.el Use lexical-binding in makesum.el and add tests 2019-05-29 20:47:16 +02:00
man-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
md4-tests.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
minibuffer-tests.el Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo" 2019-06-26 10:24:59 -04:00
mouse-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
obarray-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
paren-tests.el Use lexical-binding in paren.el and add tests 2019-05-26 11:22:27 +02:00
password-cache-tests.el Use lexical-binding in password-cache.el and add tests 2019-06-09 10:08:36 -07:00
ps-print-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
register-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
replace-tests.el * test/lisp/replace-tests.el (replace-tests-with-undo): Override 2019-07-12 22:00:56 +03:00
rot13-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
scroll-lock-tests.el New function for scroll-lock-mode to almost always scroll 2019-07-14 09:23:20 +03:00
ses-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
shadowfile-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
shell-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
simple-tests.el Fix recently extended delete-indentation behavior 2019-03-31 17:08:21 +01:00
sort-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
soundex-tests.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
subr-tests.el Add new macro `ignore-error' 2019-07-26 09:58:53 +02:00
tabify-tests.el Tweak recent additions in tabify-tests.el 2019-05-26 11:56:57 +01:00
tar-mode-tests.el * lisp/tar-mode.el (tar-extract): Call tar--try-jka-compr (bug#34251) 2019-02-03 23:00:29 +02:00
tempo-tests.el Use lexical-binding in tempo.el and add tests 2019-05-21 15:23:23 +01:00
term-tests.el Merge from emacs-26 2019-07-20 22:02:36 -04:00
thingatpt-tests.el Merge from origin/emacs-26 2019-07-06 12:51:30 -07:00
thread-tests.el Update more copyright years 2018-12-31 18:47:22 -08:00
time-stamp-tests.el Add test to time-stamp.el 2019-07-11 18:27:12 +02:00
timezone-tests.el Use lexical-binding in timezone.el and add tests 2019-06-01 01:44:31 -07:00
wdired-tests.el Stop wdired tests leaving behind symlink /tmp/emacs1000 2019-07-14 15:18:22 -07:00
whitespace-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
wid-edit-tests.el Distinguish buttons from widgets (bug#34506) 2019-04-07 03:56:27 +01:00
xdg-tests.el Go back to "Maintainer: emacs-devel@gnu.org" 2019-05-25 14:25:18 -07:00
xml-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
xt-mouse-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00