mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-06 03:40:56 -08:00
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.
This commit is contained in:
parent
85f1ad0c79
commit
72c7ee2e52
2 changed files with 14 additions and 14 deletions
|
|
@ -372,8 +372,8 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp
|
||||||
(cl--defalias 'cl-second 'cadr)
|
(cl--defalias 'cl-second 'cadr)
|
||||||
(cl--defalias 'cl-rest 'cdr)
|
(cl--defalias 'cl-rest 'cdr)
|
||||||
|
|
||||||
(cl--defalias 'cl-third 'cl-caddr "Return the third element of the list X.")
|
(cl--defalias 'cl-third #'caddr "Return the third element of the list X.")
|
||||||
(cl--defalias 'cl-fourth 'cl-cadddr "Return the fourth element of the list X.")
|
(cl--defalias 'cl-fourth #'cadddr "Return the fourth element of the list X.")
|
||||||
|
|
||||||
(defsubst cl-fifth (x)
|
(defsubst cl-fifth (x)
|
||||||
"Return the fifth element of the list X."
|
"Return the fifth element of the list X."
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ its argument list allows full Common Lisp conventions."
|
||||||
(while (and (eq (car args) '&aux) (pop args))
|
(while (and (eq (car args) '&aux) (pop args))
|
||||||
(while (and args (not (memq (car args) cl--lambda-list-keywords)))
|
(while (and args (not (memq (car args) cl--lambda-list-keywords)))
|
||||||
(if (consp (car args))
|
(if (consp (car args))
|
||||||
(if (and cl--bind-enquote (cl-cadar args))
|
(if (and cl--bind-enquote (cadar args))
|
||||||
(cl--do-arglist (caar args)
|
(cl--do-arglist (caar args)
|
||||||
`',(cadr (pop args)))
|
`',(cadr (pop args)))
|
||||||
(cl--do-arglist (caar args) (cadr (pop args))))
|
(cl--do-arglist (caar args) (cadr (pop args))))
|
||||||
|
|
@ -612,7 +612,7 @@ its argument list allows full Common Lisp conventions."
|
||||||
(if (eq ?_ (aref name 0))
|
(if (eq ?_ (aref name 0))
|
||||||
(setq name (substring name 1)))
|
(setq name (substring name 1)))
|
||||||
(intern (format ":%s" name)))))
|
(intern (format ":%s" name)))))
|
||||||
(varg (if (consp (car arg)) (cl-cadar arg) (car arg)))
|
(varg (if (consp (car arg)) (cadar arg) (car arg)))
|
||||||
(def (if (cdr arg) (cadr arg)
|
(def (if (cdr arg) (cadr arg)
|
||||||
;; The ordering between those two or clauses is
|
;; The ordering between those two or clauses is
|
||||||
;; irrelevant, since in practice only one of the two
|
;; irrelevant, since in practice only one of the two
|
||||||
|
|
@ -1339,7 +1339,7 @@ For more details, see Info node `(cl)Loop Facility'.
|
||||||
(temp-idx
|
(temp-idx
|
||||||
(if (eq (car cl--loop-args) 'using)
|
(if (eq (car cl--loop-args) 'using)
|
||||||
(if (and (= (length (cadr cl--loop-args)) 2)
|
(if (and (= (length (cadr cl--loop-args)) 2)
|
||||||
(eq (cl-caadr cl--loop-args) 'index))
|
(eq (caadr cl--loop-args) 'index))
|
||||||
(cadr (cl--pop2 cl--loop-args))
|
(cadr (cl--pop2 cl--loop-args))
|
||||||
(error "Bad `using' clause"))
|
(error "Bad `using' clause"))
|
||||||
(make-symbol "--cl-idx--"))))
|
(make-symbol "--cl-idx--"))))
|
||||||
|
|
@ -1370,8 +1370,8 @@ For more details, see Info node `(cl)Loop Facility'.
|
||||||
(other
|
(other
|
||||||
(if (eq (car cl--loop-args) 'using)
|
(if (eq (car cl--loop-args) 'using)
|
||||||
(if (and (= (length (cadr cl--loop-args)) 2)
|
(if (and (= (length (cadr cl--loop-args)) 2)
|
||||||
(memq (cl-caadr cl--loop-args) hash-types)
|
(memq (caadr cl--loop-args) hash-types)
|
||||||
(not (eq (cl-caadr cl--loop-args) word)))
|
(not (eq (caadr cl--loop-args) word)))
|
||||||
(cadr (cl--pop2 cl--loop-args))
|
(cadr (cl--pop2 cl--loop-args))
|
||||||
(error "Bad `using' clause"))
|
(error "Bad `using' clause"))
|
||||||
(make-symbol "--cl-var--"))))
|
(make-symbol "--cl-var--"))))
|
||||||
|
|
@ -1433,8 +1433,8 @@ For more details, see Info node `(cl)Loop Facility'.
|
||||||
(other
|
(other
|
||||||
(if (eq (car cl--loop-args) 'using)
|
(if (eq (car cl--loop-args) 'using)
|
||||||
(if (and (= (length (cadr cl--loop-args)) 2)
|
(if (and (= (length (cadr cl--loop-args)) 2)
|
||||||
(memq (cl-caadr cl--loop-args) key-types)
|
(memq (caadr cl--loop-args) key-types)
|
||||||
(not (eq (cl-caadr cl--loop-args) word)))
|
(not (eq (caadr cl--loop-args) word)))
|
||||||
(cadr (cl--pop2 cl--loop-args))
|
(cadr (cl--pop2 cl--loop-args))
|
||||||
(error "Bad `using' clause"))
|
(error "Bad `using' clause"))
|
||||||
(make-symbol "--cl-var--"))))
|
(make-symbol "--cl-var--"))))
|
||||||
|
|
@ -1656,7 +1656,7 @@ If BODY is `setq', then use SPECS for assignments rather than for bindings."
|
||||||
(let ((temps nil) (new nil))
|
(let ((temps nil) (new nil))
|
||||||
(when par
|
(when par
|
||||||
(let ((p specs))
|
(let ((p specs))
|
||||||
(while (and p (or (symbolp (car-safe (car p))) (null (cl-cadar p))))
|
(while (and p (or (symbolp (car-safe (car p))) (null (cadar p))))
|
||||||
(setq p (cdr p)))
|
(setq p (cdr p)))
|
||||||
(when p
|
(when p
|
||||||
(setq par nil)
|
(setq par nil)
|
||||||
|
|
@ -1731,7 +1731,7 @@ such that COMBO is equivalent to (and . CLAUSES)."
|
||||||
(setq clauses (cons (nconc (butlast (car clauses))
|
(setq clauses (cons (nconc (butlast (car clauses))
|
||||||
(if (eq (car-safe (cadr clauses))
|
(if (eq (car-safe (cadr clauses))
|
||||||
'progn)
|
'progn)
|
||||||
(cl-cdadr clauses)
|
(cdadr clauses)
|
||||||
(list (cadr clauses))))
|
(list (cadr clauses))))
|
||||||
(cddr clauses)))
|
(cddr clauses)))
|
||||||
;; A final (progn ,@A t) is moved outside of the `and'.
|
;; A final (progn ,@A t) is moved outside of the `and'.
|
||||||
|
|
@ -2613,7 +2613,7 @@ Example:
|
||||||
((and (eq (car-safe spec) 'warn) (boundp 'byte-compile-warnings))
|
((and (eq (car-safe spec) 'warn) (boundp 'byte-compile-warnings))
|
||||||
(while (setq spec (cdr spec))
|
(while (setq spec (cdr spec))
|
||||||
(if (consp (car spec))
|
(if (consp (car spec))
|
||||||
(if (eq (cl-cadar spec) 0)
|
(if (eq (cadar spec) 0)
|
||||||
(byte-compile-disable-warning (caar spec))
|
(byte-compile-disable-warning (caar spec))
|
||||||
(byte-compile-enable-warning (caar spec)))))))
|
(byte-compile-enable-warning (caar spec)))))))
|
||||||
nil)
|
nil)
|
||||||
|
|
@ -3093,9 +3093,9 @@ To see the documentation for a defined struct type, use
|
||||||
(t `(and (consp cl-x)
|
(t `(and (consp cl-x)
|
||||||
(memq (nth ,pos cl-x) ,tag-symbol))))))
|
(memq (nth ,pos cl-x) ,tag-symbol))))))
|
||||||
pred-check (and pred-form (> safety 0)
|
pred-check (and pred-form (> safety 0)
|
||||||
(if (and (eq (cl-caadr pred-form) 'vectorp)
|
(if (and (eq (caadr pred-form) 'vectorp)
|
||||||
(= safety 1))
|
(= safety 1))
|
||||||
(cons 'and (cl-cdddr pred-form))
|
(cons 'and (cdddr pred-form))
|
||||||
`(,predicate cl-x))))
|
`(,predicate cl-x))))
|
||||||
(when pred-form
|
(when pred-form
|
||||||
(push `(,defsym ,predicate (cl-x)
|
(push `(,defsym ,predicate (cl-x)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue