aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2025-02-15 00:40:52 +0100
committerStefan Kangas2025-02-15 00:40:52 +0100
commitdc86f59e926f618d4e3568a332b42ea0647a08ba (patch)
treece125d5cb7e7a6fa95bc09c9c843601dc3b549a8
parentf05ce9e6bbe7202060580c122e033f5e4ac98e90 (diff)
downloademacs-dc86f59e926f618d4e3568a332b42ea0647a08ba.tar.gz
emacs-dc86f59e926f618d4e3568a332b42ea0647a08ba.zip
Prefer `(defsubst A ...)` to `(cl-proclaim (inline A))`
* lisp/emacs-lisp/cl-macs.el: Remove cl-proclaim... * lisp/emacs-lisp/cl-extra.el (cl-map, cl-notany, cl-notevery) (cl-revappend, cl-nreconc): * lisp/emacs-lisp/cl-lib.el (cl-acons): ...and use defsubst instead. (Bug#76294)
-rw-r--r--lisp/emacs-lisp/cl-extra.el10
-rw-r--r--lisp/emacs-lisp/cl-lib.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el4
3 files changed, 6 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 62e12217e0d..09470457d93 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -127,7 +127,7 @@ strings case-insensitively."
127 (and acc (nreverse cl-res))))) 127 (and acc (nreverse cl-res)))))
128 128
129;;;###autoload 129;;;###autoload
130(defun cl-map (cl-type cl-func cl-seq &rest cl-rest) 130(defsubst cl-map (cl-type cl-func cl-seq &rest cl-rest)
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...)"
@@ -239,14 +239,14 @@ non-nil value.
239 (null cl-seq))) 239 (null cl-seq)))
240 240
241;;;###autoload 241;;;###autoload
242(defun cl-notany (cl-pred cl-seq &rest cl-rest) 242(defsubst cl-notany (cl-pred cl-seq &rest cl-rest)
243 "Return true if PREDICATE is false of every element of SEQ or SEQs. 243 "Return true if PREDICATE is false of every element of SEQ or SEQs.
244\n(fn PREDICATE SEQ...)" 244\n(fn PREDICATE SEQ...)"
245 (declare (important-return-value t)) 245 (declare (important-return-value t))
246 (not (apply #'cl-some cl-pred cl-seq cl-rest))) 246 (not (apply #'cl-some cl-pred cl-seq cl-rest)))
247 247
248;;;###autoload 248;;;###autoload
249(defun cl-notevery (cl-pred cl-seq &rest cl-rest) 249(defsubst cl-notevery (cl-pred cl-seq &rest cl-rest)
250 "Return true if PREDICATE is false of some element of SEQ or SEQs. 250 "Return true if PREDICATE is false of some element of SEQ or SEQs.
251\n(fn PREDICATE SEQ...)" 251\n(fn PREDICATE SEQ...)"
252 (declare (important-return-value t)) 252 (declare (important-return-value t))
@@ -589,13 +589,13 @@ too large if positive or too small if negative)."
589;;; List functions. 589;;; List functions.
590 590
591;;;###autoload 591;;;###autoload
592(defun cl-revappend (x y) 592(defsubst cl-revappend (x y)
593 "Equivalent to (append (reverse X) Y)." 593 "Equivalent to (append (reverse X) Y)."
594 (declare (side-effect-free t)) 594 (declare (side-effect-free t))
595 (nconc (reverse x) y)) 595 (nconc (reverse x) y))
596 596
597;;;###autoload 597;;;###autoload
598(defun cl-nreconc (x y) 598(defsubst cl-nreconc (x y)
599 "Equivalent to (nconc (nreverse X) Y)." 599 "Equivalent to (nconc (nreverse X) Y)."
600 (declare (important-return-value t)) 600 (declare (important-return-value t))
601 (nconc (nreverse x) y)) 601 (nconc (nreverse x) y))
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index 883a13e3244..dba01b28325 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -535,7 +535,7 @@ Return a copy of TREE with all elements `eql' to OLD replaced by NEW.
535 cl-tree (cons a d)))) 535 cl-tree (cons a d))))
536 (t cl-tree))) 536 (t cl-tree)))
537 537
538(defun cl-acons (key value alist) 538(defsubst cl-acons (key value alist)
539 "Add KEY and VALUE to ALIST. 539 "Add KEY and VALUE to ALIST.
540Return a new list with (cons KEY VALUE) as car and ALIST as cdr." 540Return a new list with (cons KEY VALUE) as car and ALIST as cdr."
541 (declare (side-effect-free error-free)) 541 (declare (side-effect-free error-free))
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 44fe67b6c85..caaffcf19be 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -3725,10 +3725,6 @@ macro that returns its `&whole' argument."
3725 `(cl-getf (symbol-plist ,sym) ,prop ,def) 3725 `(cl-getf (symbol-plist ,sym) ,prop ,def)
3726 `(get ,sym ,prop))) 3726 `(get ,sym ,prop)))
3727 3727
3728;;; Things that are inline.
3729(cl-proclaim '(inline cl-acons cl-map cl-notany cl-notevery cl-revappend
3730 cl-nreconc))
3731
3732;;; Types and assertions. 3728;;; Types and assertions.
3733 3729
3734;;;###autoload 3730;;;###autoload