aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/cl-extra.el23
-rw-r--r--lisp/emacs-lisp/cl-macs.el9
-rw-r--r--lisp/emacs-lisp/ert.el13
3 files changed, 18 insertions, 27 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 84199c16127..eabba27d229 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -94,7 +94,7 @@ strings case-insensitively."
94(defun cl--mapcar-many (cl-func cl-seqs &optional acc) 94(defun cl--mapcar-many (cl-func cl-seqs &optional acc)
95 (if (cdr (cdr cl-seqs)) 95 (if (cdr (cdr cl-seqs))
96 (let* ((cl-res nil) 96 (let* ((cl-res nil)
97 (cl-n (apply 'min (mapcar 'length cl-seqs))) 97 (cl-n (apply #'min (mapcar #'length cl-seqs)))
98 (cl-i 0) 98 (cl-i 0)
99 (cl-args (copy-sequence cl-seqs)) 99 (cl-args (copy-sequence cl-seqs))
100 cl-p1 cl-p2) 100 cl-p1 cl-p2)
@@ -131,7 +131,7 @@ strings case-insensitively."
131 "Map a FUNCTION across one or more SEQUENCEs, returning a sequence. 131 "Map a FUNCTION across one or more SEQUENCEs, returning a sequence.
132TYPE is the sequence type to return. 132TYPE is the sequence type to return.
133\n(fn TYPE FUNCTION SEQUENCE...)" 133\n(fn TYPE FUNCTION SEQUENCE...)"
134 (let ((cl-res (apply 'cl-mapcar cl-func cl-seq cl-rest))) 134 (let ((cl-res (apply #'cl-mapcar cl-func cl-seq cl-rest)))
135 (and cl-type (cl-coerce cl-res cl-type)))) 135 (and cl-type (cl-coerce cl-res cl-type))))
136 136
137;;;###autoload 137;;;###autoload
@@ -190,14 +190,14 @@ the elements themselves.
190 "Like `cl-mapcar', but nconc's together the values returned by the function. 190 "Like `cl-mapcar', but nconc's together the values returned by the function.
191\n(fn FUNCTION SEQUENCE...)" 191\n(fn FUNCTION SEQUENCE...)"
192 (if cl-rest 192 (if cl-rest
193 (apply 'nconc (apply 'cl-mapcar cl-func cl-seq cl-rest)) 193 (apply #'nconc (apply #'cl-mapcar cl-func cl-seq cl-rest))
194 (mapcan cl-func cl-seq))) 194 (mapcan cl-func cl-seq)))
195 195
196;;;###autoload 196;;;###autoload
197(defun cl-mapcon (cl-func cl-list &rest cl-rest) 197(defun cl-mapcon (cl-func cl-list &rest cl-rest)
198 "Like `cl-maplist', but nconc's together the values returned by the function. 198 "Like `cl-maplist', but nconc's together the values returned by the function.
199\n(fn FUNCTION LIST...)" 199\n(fn FUNCTION LIST...)"
200 (apply 'nconc (apply 'cl-maplist cl-func cl-list cl-rest))) 200 (apply #'nconc (apply #'cl-maplist cl-func cl-list cl-rest)))
201 201
202;;;###autoload 202;;;###autoload
203(defun cl-some (cl-pred cl-seq &rest cl-rest) 203(defun cl-some (cl-pred cl-seq &rest cl-rest)
@@ -236,13 +236,13 @@ non-nil value.
236(defun cl-notany (cl-pred cl-seq &rest cl-rest) 236(defun cl-notany (cl-pred cl-seq &rest cl-rest)
237 "Return true if PREDICATE is false of every element of SEQ or SEQs. 237 "Return true if PREDICATE is false of every element of SEQ or SEQs.
238\n(fn PREDICATE SEQ...)" 238\n(fn PREDICATE SEQ...)"
239 (not (apply 'cl-some cl-pred cl-seq cl-rest))) 239 (not (apply #'cl-some cl-pred cl-seq cl-rest)))
240 240
241;;;###autoload 241;;;###autoload
242(defun cl-notevery (cl-pred cl-seq &rest cl-rest) 242(defun cl-notevery (cl-pred cl-seq &rest cl-rest)
243 "Return true if PREDICATE is false of some element of SEQ or SEQs. 243 "Return true if PREDICATE is false of some element of SEQ or SEQs.
244\n(fn PREDICATE SEQ...)" 244\n(fn PREDICATE SEQ...)"
245 (not (apply 'cl-every cl-pred cl-seq cl-rest))) 245 (not (apply #'cl-every cl-pred cl-seq cl-rest)))
246 246
247;;;###autoload 247;;;###autoload
248(defun cl--map-keymap-recursively (cl-func-rec cl-map &optional cl-base) 248(defun cl--map-keymap-recursively (cl-func-rec cl-map &optional cl-base)
@@ -693,12 +693,11 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
693 "Expand macros in FORM and insert the pretty-printed result." 693 "Expand macros in FORM and insert the pretty-printed result."
694 (declare (advertised-calling-convention (form) "27.1")) 694 (declare (advertised-calling-convention (form) "27.1"))
695 (message "Expanding...") 695 (message "Expanding...")
696 (let ((byte-compile-macro-environment nil)) 696 (setq form (macroexpand-all form))
697 (setq form (macroexpand-all form)) 697 (message "Formatting...")
698 (message "Formatting...") 698 (prog1
699 (prog1 699 (cl-prettyprint form)
700 (cl-prettyprint form) 700 (message "")))
701 (message ""))))
702 701
703;;; Integration into the online help system. 702;;; Integration into the online help system.
704 703
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 007466bbb00..91146c4d0ec 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -723,7 +723,7 @@ If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level.
723(defun cl--compile-time-too (form) 723(defun cl--compile-time-too (form)
724 (or (and (symbolp (car-safe form)) (get (car-safe form) 'byte-hunk-handler)) 724 (or (and (symbolp (car-safe form)) (get (car-safe form) 'byte-hunk-handler))
725 (setq form (macroexpand 725 (setq form (macroexpand
726 form (cons '(cl-eval-when) byte-compile-macro-environment)))) 726 form (cons '(cl-eval-when) macroexpand-all-environment))))
727 (cond ((eq (car-safe form) 'progn) 727 (cond ((eq (car-safe form) 'progn)
728 (cons 'progn (mapcar #'cl--compile-time-too (cdr form)))) 728 (cons 'progn (mapcar #'cl--compile-time-too (cdr form))))
729 ((eq (car-safe form) 'cl-eval-when) 729 ((eq (car-safe form) 'cl-eval-when)
@@ -2481,12 +2481,12 @@ values. For compatibility, (cl-values A B C) is a synonym for (list A B C).
2481 '(nil byte-compile-inline-expand)) 2481 '(nil byte-compile-inline-expand))
2482 (error "%s already has a byte-optimizer, can't make it inline" 2482 (error "%s already has a byte-optimizer, can't make it inline"
2483 (car spec))) 2483 (car spec)))
2484 (put (car spec) 'byte-optimizer 'byte-compile-inline-expand))) 2484 (put (car spec) 'byte-optimizer #'byte-compile-inline-expand)))
2485 2485
2486 ((eq (car-safe spec) 'notinline) 2486 ((eq (car-safe spec) 'notinline)
2487 (while (setq spec (cdr spec)) 2487 (while (setq spec (cdr spec))
2488 (if (eq (get (car spec) 'byte-optimizer) 2488 (if (eq (get (car spec) 'byte-optimizer)
2489 'byte-compile-inline-expand) 2489 #'byte-compile-inline-expand)
2490 (put (car spec) 'byte-optimizer nil)))) 2490 (put (car spec) 'byte-optimizer nil))))
2491 2491
2492 ((eq (car-safe spec) 'optimize) 2492 ((eq (car-safe spec) 'optimize)
@@ -3257,7 +3257,6 @@ does not contain SLOT-NAME."
3257 (signal 'cl-struct-unknown-slot (list struct-type slot-name)))) 3257 (signal 'cl-struct-unknown-slot (list struct-type slot-name))))
3258 3258
3259(defvar byte-compile-function-environment) 3259(defvar byte-compile-function-environment)
3260(defvar byte-compile-macro-environment)
3261 3260
3262(defun cl--macroexp-fboundp (sym) 3261(defun cl--macroexp-fboundp (sym)
3263 "Return non-nil if SYM will be bound when we run the code. 3262 "Return non-nil if SYM will be bound when we run the code.
@@ -3265,7 +3264,7 @@ Of course, we really can't know that for sure, so it's just a heuristic."
3265 (or (fboundp sym) 3264 (or (fboundp sym)
3266 (and (macroexp-compiling-p) 3265 (and (macroexp-compiling-p)
3267 (or (cdr (assq sym byte-compile-function-environment)) 3266 (or (cdr (assq sym byte-compile-function-environment))
3268 (cdr (assq sym byte-compile-macro-environment)))))) 3267 (cdr (assq sym macroexpand-all-environment))))))
3269 3268
3270(pcase-dolist (`(,type . ,pred) 3269(pcase-dolist (`(,type . ,pred)
3271 ;; Mostly kept in alphabetical order. 3270 ;; Mostly kept in alphabetical order.
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index a5c877e53ad..155b6a9d4e6 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -277,14 +277,7 @@ It should only be stopped when ran from inside ert--run-test-internal."
277 (let ((form 277 (let ((form
278 ;; catch macroexpansion errors 278 ;; catch macroexpansion errors
279 (condition-case err 279 (condition-case err
280 (macroexpand-all form 280 (macroexpand-all form macroexpand-all-environment)
281 (append (bound-and-true-p
282 byte-compile-macro-environment)
283 (cond
284 ((boundp 'macroexpand-all-environment)
285 macroexpand-all-environment)
286 ((boundp 'cl-macro-environment)
287 cl-macro-environment))))
288 (error `(signal ',(car err) ',(cdr err)))))) 281 (error `(signal ',(car err) ',(cdr err))))))
289 (cond 282 (cond
290 ((or (atom form) (ert--special-operator-p (car form))) 283 ((or (atom form) (ert--special-operator-p (car form)))
@@ -1550,7 +1543,7 @@ Ran \\([0-9]+\\) tests, \\([0-9]+\\) results as expected\
1550 (message "------------------") 1543 (message "------------------")
1551 (setq tests (sort tests (lambda (x y) (> (car x) (car y))))) 1544 (setq tests (sort tests (lambda (x y) (> (car x) (car y)))))
1552 (when (< high (length tests)) (setcdr (nthcdr (1- high) tests) nil)) 1545 (when (< high (length tests)) (setcdr (nthcdr (1- high) tests) nil))
1553 (message "%s" (mapconcat 'cdr tests "\n"))) 1546 (message "%s" (mapconcat #'cdr tests "\n")))
1554 ;; More details on hydra, where the logs are harder to get to. 1547 ;; More details on hydra, where the logs are harder to get to.
1555 (when (and (getenv "EMACS_HYDRA_CI") 1548 (when (and (getenv "EMACS_HYDRA_CI")
1556 (not (zerop (+ nunexpected nskipped)))) 1549 (not (zerop (+ nunexpected nskipped))))
@@ -2077,7 +2070,7 @@ and how to display message."
2077 (ert-run-tests selector listener t))) 2070 (ert-run-tests selector listener t)))
2078 2071
2079;;;###autoload 2072;;;###autoload
2080(defalias 'ert 'ert-run-tests-interactively) 2073(defalias 'ert #'ert-run-tests-interactively)
2081 2074
2082 2075
2083;;; Simple view mode for auxiliary information like stack traces or 2076;;; Simple view mode for auxiliary information like stack traces or