Function: cl-subst
cl-subst is a byte-compiled function defined in cl-lib.el.gz.
Signature
(cl-subst NEW OLD TREE [KEYWORD VALUE]...)
Documentation
Substitute NEW for OLD everywhere in TREE (non-destructively).
Return a copy of TREE with all elements eql to OLD replaced by NEW.
Keywords supported: :test :test-not :key
Aliases
subst (obsolete since 27.1)
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-lib.el.gz
(defun cl-subst (new old tree &rest keys)
"Substitute NEW for OLD everywhere in TREE (non-destructively).
Return a copy of TREE with all elements `eql' to OLD replaced by NEW.
\nKeywords supported: :test :test-not :key
\n(fn NEW OLD TREE [KEYWORD VALUE]...)"
(declare (important-return-value t))
(if (or keys (and (numberp old) (not (integerp old))))
(apply 'cl-sublis (list (cons old new)) tree keys)
(cl--do-subst new old tree)))