1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-02 11:50:48 -08:00
emacs/lisp/progmodes
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
..
ada-mode.el Merge from origin/emacs-26 2019-07-06 12:52:12 -07:00
ada-prj.el
ada-stmt.el
ada-xref.el
antlr-mode.el
asm-mode.el Use lexical-binding in asm-mode.el and add tests 2019-07-18 20:41:47 +02:00
autoconf.el
bat-mode.el
bug-reference.el
cc-align.el
cc-awk.el * lisp/progmodes/cc-awk.el (c-awk-var-num-ket-re): Remove /x80-/xff from it. 2019-07-25 18:48:19 +00:00
cc-bytecomp.el
cc-cmds.el New function time-convert 2019-08-05 18:37:29 -07:00
cc-defs.el Fix usage of remove-text-properties 2019-08-01 17:04:53 +03:00
cc-engine.el CC Mode: Fix error in macro cache. This fixes bug #36802 2019-08-02 13:39:57 +00:00
cc-fonts.el CC Mode: Stop /**/ spuriously fontifying as a doc comment under gtkdoc 2019-07-27 12:55:53 +00:00
cc-guess.el
cc-langs.el CC Mode: Fix spurious recognition of operators beginning with, e.g. "or" 2019-08-02 12:57:40 +00:00
cc-menus.el
cc-mode.el Fix 2019-08-04 regex lint 2019-08-04 11:39:54 -07:00
cc-styles.el
cc-vars.el C++ Mode: change the default doc comment style from nothing to gtkdoc 2019-06-30 15:02:13 +00:00
cfengine.el
cmacexp.el
compile.el Merge commit '9b480db673' 2019-07-30 11:03:15 -07:00
cperl-mode.el New function time-convert 2019-08-05 18:37:29 -07:00
cpp.el
cwarn.el
dcl-mode.el
ebnf-abn.el Replace manually crafted hex regexes with [:xdigit:] 2019-07-06 10:54:25 +03:00
ebnf-bnf.el
ebnf-dtd.el Replace manually crafted hex regexes with [:xdigit:] 2019-07-06 10:54:25 +03:00
ebnf-ebx.el Replace manually crafted hex regexes with [:xdigit:] 2019-07-06 10:54:25 +03:00
ebnf-iso.el
ebnf-otz.el
ebnf-yac.el
ebnf2ps.el
ebrowse.el Fix usage of remove-text-properties 2019-08-01 17:04:53 +03:00
elisp-mode.el Remove debugging left in previous patch 2019-07-26 10:00:47 +02:00
etags.el Minor doc fix in etags.el 2019-08-03 12:59:18 +03:00
executable.el * lisp/emacs-lisp/bytecomp.el (byte-compile-dynamic): Mark obsolete 2019-06-21 10:30:50 -04:00
f90.el
flymake-cc.el More carefully cleanup Flymake C/C++ backend's temp buffers 2019-07-02 16:09:59 +01:00
flymake-proc.el
flymake.el New function time-convert 2019-08-05 18:37:29 -07:00
fortran.el
gdb-mi.el Fix 2019-08-04 regex lint 2019-08-04 11:39:54 -07:00
glasses.el
grep.el Improve doc strings for some -search-path variables 2019-07-30 11:02:03 -07:00
gud.el pdb doc clarification 2019-08-02 14:46:55 +02:00
hideif.el Replace manually crafted hex regexes with [:xdigit:] 2019-07-06 10:54:25 +03:00
hideshow.el Fix progression in hideshow.el 2019-08-02 21:21:23 +02:00
icon.el
idlw-complete-structtag.el
idlw-help.el
idlw-shell.el Fix usage of remove-text-properties 2019-08-01 17:04:53 +03:00
idlw-toolbar.el
idlwave.el
inf-lisp.el
js.el
ld-script.el
m4-mode.el
make-mode.el Fix usage of remove-text-properties 2019-08-01 17:04:53 +03:00
meta-mode.el
mixal-mode.el
modula2.el Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo" 2019-06-26 10:24:59 -04:00
octave.el * lisp/progmodes/octave.el (matchedrules): Add spmd...end (bug#36703) 2019-07-20 12:05:07 -04:00
opascal.el * lisp/progmodes/opascal.el: Tweak code to ease edebugging 2019-07-22 15:41:17 -04:00
pascal.el Remove XEmacs compat code from pascal.el 2019-06-20 12:51:38 +02:00
perl-mode.el
prog-mode.el Fix usage of remove-text-properties 2019-08-01 17:04:53 +03:00
project.el
prolog.el Replace manually crafted hex regexes with [:xdigit:] 2019-07-06 10:54:25 +03:00
ps-mode.el
python.el Merge from origin/emacs-26 2019-07-06 12:51:30 -07:00
ruby-mode.el Fix usage of remove-text-properties 2019-08-01 17:04:53 +03:00
scheme.el
sh-script.el * lisp/progmodes/sh-script.el (sh-assignment): Put delete-selection on symbol 2019-07-16 01:00:49 +03:00
simula.el
sql.el
subword.el
tcl.el
vera-mode.el Replace manually crafted hex regexes with [:xdigit:] 2019-07-06 10:54:25 +03:00
verilog-mode.el * lisp/progmodes/verilog-mode.el: Update Version: 2019-07-09 09:30:49 -04:00
vhdl-mode.el New function time-convert 2019-08-05 18:37:29 -07:00
which-func.el
xref.el Fix recent commit in xref.el 2019-07-25 19:32:25 +03:00
xscheme.el