diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-03-08 00:20:57 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-03-08 00:20:57 -0800 |
commit | 4415534ef01309417e8f552eb4c075095603f2f3 (patch) | |
tree | ca55889bb9636c2b2d16e4a29fcc14b2d18e3fdc /lisp/emacs-lisp | |
parent | e4fb95fa18072cedb021a82f7aa0e79fa6ca387a (diff) | |
parent | 0a3682a566d5563e3d57defe49359cee236e0274 (diff) | |
download | emacs-4415534ef01309417e8f552eb4c075095603f2f3.tar.gz emacs-4415534ef01309417e8f552eb4c075095603f2f3.tar.bz2 emacs-4415534ef01309417e8f552eb4c075095603f2f3.zip |
Merge from origin/emacs-27
0a3682a566 * src/timefns.c: Add comments.
b16ba4041d ; lisp/emacs-lisp/seq.el: Explain why we don't use cl-lib ...
3cbf4cb796 Eliminate use of cl-concatenate in 'seq' package
363d927086 Fix bug with JIT stealth timers
818333c85a * doc/lispref/os.texi (time-subtract): Doc fix.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-extra.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/seq.el | 10 | ||||
-rw-r--r-- | lisp/emacs-lisp/timer.el | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index e3dabdfcef2..e9bfe8df5f2 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -556,11 +556,7 @@ too large if positive or too small if negative)." (defun cl-concatenate (type &rest sequences) "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs. \n(fn TYPE SEQUENCE...)" - (pcase type - ('vector (apply #'vconcat sequences)) - ('string (apply #'concat sequences)) - ('list (apply #'append (append sequences '(nil)))) - (_ (error "Not a sequence type name: %S" type)))) + (seq-concatenate type sequences)) ;;; List functions. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 0b946dd7365..e3037a71901 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -58,6 +58,10 @@ (eval-when-compile (require 'cl-generic)) +;; We used to use some sequence functions from cl-lib, but this +;; dependency was swapped around so that it will be easier to make +;; seq.el preloaded in the future. See also Bug#39761#26. + (defmacro seq-doseq (spec &rest body) "Loop over a sequence. Evaluate BODY with VAR bound to each element of SEQUENCE, in turn. @@ -285,7 +289,11 @@ sorted. FUNCTION must be a function of one argument." TYPE must be one of following symbols: vector, string or list. \n(fn TYPE SEQUENCE...)" - (apply #'cl-concatenate type (seq-map #'seq-into-sequence sequences))) + (pcase type + ('vector (apply #'vconcat sequences)) + ('string (apply #'concat sequences)) + ('list (apply #'append (append sequences '(nil)))) + (_ (error "Not a sequence type name: %S" type)))) (cl-defgeneric seq-into-sequence (sequence) "Convert SEQUENCE into a sequence. diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 74a94957e73..9eb8feed0f1 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -378,7 +378,7 @@ This function returns a timer object which you can use in (decoded-time-year now) (decoded-time-zone now))))))) - (or (consp time) + (or (time-equal-p time time) (error "Invalid time format")) (let ((timer (timer-create))) |