aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-08-03 01:40:32 +0200
committerStefan Kangas2022-08-03 02:59:40 +0200
commit72c7ee2e525d87b58a28aea8af8cef31f607d7c0 (patch)
tree8073020a2a2b250fb35c4d87cc24112ee789930d
parent85f1ad0c798b5556c37185f4930929d5aa386a5e (diff)
downloademacs-72c7ee2e525d87b58a28aea8af8cef31f607d7c0.tar.gz
emacs-72c7ee2e525d87b58a28aea8af8cef31f607d7c0.zip
Avoid cl-cXXXr compat aliases
* lisp/emacs-lisp/cl-lib.el (cl-third, cl-fourth): * lisp/emacs-lisp/cl-macs.el (cl--do-&aux, cl--do-arglist) (cl--parse-loop-clause, cl--loop-let, cl--loop-build-ands) (cl--do-proclaim, cl-defstruct): Prefer using cXXXr functions directly, instead of cl-cXXXr prefixed compat aliases.
-rw-r--r--lisp/emacs-lisp/cl-lib.el4
-rw-r--r--lisp/emacs-lisp/cl-macs.el24
2 files changed, 14 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index 3f40ab07605..a54fa21fa96 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -372,8 +372,8 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp
372(cl--defalias 'cl-second 'cadr) 372(cl--defalias 'cl-second 'cadr)
373(cl--defalias 'cl-rest 'cdr) 373(cl--defalias 'cl-rest 'cdr)
374 374
375(cl--defalias 'cl-third 'cl-caddr "Return the third element of the list X.") 375(cl--defalias 'cl-third #'caddr "Return the third element of the list X.")
376(cl--defalias 'cl-fourth 'cl-cadddr "Return the fourth element of the list X.") 376(cl--defalias 'cl-fourth #'cadddr "Return the fourth element of the list X.")
377 377
378(defsubst cl-fifth (x) 378(defsubst cl-fifth (x)
379 "Return the fifth element of the list X." 379 "Return the fifth element of the list X."
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 727b3098e34..12917c99e10 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -527,7 +527,7 @@ its argument list allows full Common Lisp conventions."
527 (while (and (eq (car args) '&aux) (pop args)) 527 (while (and (eq (car args) '&aux) (pop args))
528 (while (and args (not (memq (car args) cl--lambda-list-keywords))) 528 (while (and args (not (memq (car args) cl--lambda-list-keywords)))
529 (if (consp (car args)) 529 (if (consp (car args))
530 (if (and cl--bind-enquote (cl-cadar args)) 530 (if (and cl--bind-enquote (cadar args))
531 (cl--do-arglist (caar args) 531 (cl--do-arglist (caar args)
532 `',(cadr (pop args))) 532 `',(cadr (pop args)))
533 (cl--do-arglist (caar args) (cadr (pop args)))) 533 (cl--do-arglist (caar args) (cadr (pop args))))
@@ -612,7 +612,7 @@ its argument list allows full Common Lisp conventions."
612 (if (eq ?_ (aref name 0)) 612 (if (eq ?_ (aref name 0))
613 (setq name (substring name 1))) 613 (setq name (substring name 1)))
614 (intern (format ":%s" name))))) 614 (intern (format ":%s" name)))))
615 (varg (if (consp (car arg)) (cl-cadar arg) (car arg))) 615 (varg (if (consp (car arg)) (cadar arg) (car arg)))
616 (def (if (cdr arg) (cadr arg) 616 (def (if (cdr arg) (cadr arg)
617 ;; The ordering between those two or clauses is 617 ;; The ordering between those two or clauses is
618 ;; irrelevant, since in practice only one of the two 618 ;; irrelevant, since in practice only one of the two
@@ -1339,7 +1339,7 @@ For more details, see Info node `(cl)Loop Facility'.
1339 (temp-idx 1339 (temp-idx
1340 (if (eq (car cl--loop-args) 'using) 1340 (if (eq (car cl--loop-args) 'using)
1341 (if (and (= (length (cadr cl--loop-args)) 2) 1341 (if (and (= (length (cadr cl--loop-args)) 2)
1342 (eq (cl-caadr cl--loop-args) 'index)) 1342 (eq (caadr cl--loop-args) 'index))
1343 (cadr (cl--pop2 cl--loop-args)) 1343 (cadr (cl--pop2 cl--loop-args))
1344 (error "Bad `using' clause")) 1344 (error "Bad `using' clause"))
1345 (make-symbol "--cl-idx--")))) 1345 (make-symbol "--cl-idx--"))))
@@ -1370,8 +1370,8 @@ For more details, see Info node `(cl)Loop Facility'.
1370 (other 1370 (other
1371 (if (eq (car cl--loop-args) 'using) 1371 (if (eq (car cl--loop-args) 'using)
1372 (if (and (= (length (cadr cl--loop-args)) 2) 1372 (if (and (= (length (cadr cl--loop-args)) 2)
1373 (memq (cl-caadr cl--loop-args) hash-types) 1373 (memq (caadr cl--loop-args) hash-types)
1374 (not (eq (cl-caadr cl--loop-args) word))) 1374 (not (eq (caadr cl--loop-args) word)))
1375 (cadr (cl--pop2 cl--loop-args)) 1375 (cadr (cl--pop2 cl--loop-args))
1376 (error "Bad `using' clause")) 1376 (error "Bad `using' clause"))
1377 (make-symbol "--cl-var--")))) 1377 (make-symbol "--cl-var--"))))
@@ -1433,8 +1433,8 @@ For more details, see Info node `(cl)Loop Facility'.
1433 (other 1433 (other
1434 (if (eq (car cl--loop-args) 'using) 1434 (if (eq (car cl--loop-args) 'using)
1435 (if (and (= (length (cadr cl--loop-args)) 2) 1435 (if (and (= (length (cadr cl--loop-args)) 2)
1436 (memq (cl-caadr cl--loop-args) key-types) 1436 (memq (caadr cl--loop-args) key-types)
1437 (not (eq (cl-caadr cl--loop-args) word))) 1437 (not (eq (caadr cl--loop-args) word)))
1438 (cadr (cl--pop2 cl--loop-args)) 1438 (cadr (cl--pop2 cl--loop-args))
1439 (error "Bad `using' clause")) 1439 (error "Bad `using' clause"))
1440 (make-symbol "--cl-var--")))) 1440 (make-symbol "--cl-var--"))))
@@ -1656,7 +1656,7 @@ If BODY is `setq', then use SPECS for assignments rather than for bindings."
1656 (let ((temps nil) (new nil)) 1656 (let ((temps nil) (new nil))
1657 (when par 1657 (when par
1658 (let ((p specs)) 1658 (let ((p specs))
1659 (while (and p (or (symbolp (car-safe (car p))) (null (cl-cadar p)))) 1659 (while (and p (or (symbolp (car-safe (car p))) (null (cadar p))))
1660 (setq p (cdr p))) 1660 (setq p (cdr p)))
1661 (when p 1661 (when p
1662 (setq par nil) 1662 (setq par nil)
@@ -1731,7 +1731,7 @@ such that COMBO is equivalent to (and . CLAUSES)."
1731 (setq clauses (cons (nconc (butlast (car clauses)) 1731 (setq clauses (cons (nconc (butlast (car clauses))
1732 (if (eq (car-safe (cadr clauses)) 1732 (if (eq (car-safe (cadr clauses))
1733 'progn) 1733 'progn)
1734 (cl-cdadr clauses) 1734 (cdadr clauses)
1735 (list (cadr clauses)))) 1735 (list (cadr clauses))))
1736 (cddr clauses))) 1736 (cddr clauses)))
1737 ;; A final (progn ,@A t) is moved outside of the `and'. 1737 ;; A final (progn ,@A t) is moved outside of the `and'.
@@ -2613,7 +2613,7 @@ Example:
2613 ((and (eq (car-safe spec) 'warn) (boundp 'byte-compile-warnings)) 2613 ((and (eq (car-safe spec) 'warn) (boundp 'byte-compile-warnings))
2614 (while (setq spec (cdr spec)) 2614 (while (setq spec (cdr spec))
2615 (if (consp (car spec)) 2615 (if (consp (car spec))
2616 (if (eq (cl-cadar spec) 0) 2616 (if (eq (cadar spec) 0)
2617 (byte-compile-disable-warning (caar spec)) 2617 (byte-compile-disable-warning (caar spec))
2618 (byte-compile-enable-warning (caar spec))))))) 2618 (byte-compile-enable-warning (caar spec)))))))
2619 nil) 2619 nil)
@@ -3093,9 +3093,9 @@ To see the documentation for a defined struct type, use
3093 (t `(and (consp cl-x) 3093 (t `(and (consp cl-x)
3094 (memq (nth ,pos cl-x) ,tag-symbol)))))) 3094 (memq (nth ,pos cl-x) ,tag-symbol))))))
3095 pred-check (and pred-form (> safety 0) 3095 pred-check (and pred-form (> safety 0)
3096 (if (and (eq (cl-caadr pred-form) 'vectorp) 3096 (if (and (eq (caadr pred-form) 'vectorp)
3097 (= safety 1)) 3097 (= safety 1))
3098 (cons 'and (cl-cdddr pred-form)) 3098 (cons 'and (cdddr pred-form))
3099 `(,predicate cl-x)))) 3099 `(,predicate cl-x))))
3100 (when pred-form 3100 (when pred-form
3101 (push `(,defsym ,predicate (cl-x) 3101 (push `(,defsym ,predicate (cl-x)