From: Juri Linkov Date: Thu, 11 Mar 2021 19:08:09 +0000 (+0200) Subject: Update docstrings of 'delete'/'remove' to interlink each other (bug#47054) X-Git-Tag: emacs-28.0.90~3315 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b90c658492a2548f183bf072be50f4a57a2b5f0b;p=emacs.git Update docstrings of 'delete'/'remove' to interlink each other (bug#47054) * lisp/subr.el (remove): Add xref to 'delete'. * src/fns.c (Fdelete): Add xref to 'remove'. --- diff --git a/lisp/subr.el b/lisp/subr.el index 77bc7a33b38..ef0e5e6f780 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -887,7 +887,9 @@ Example: (defun remove (elt seq) "Return a copy of SEQ with all occurrences of ELT removed. -SEQ must be a list, vector, or string. The comparison is done with `equal'." +SEQ must be a list, vector, or string. The comparison is done with `equal'. +Contrary to `delete', this does not use side-effects, and the argument +SEQ is not modified." (declare (side-effect-free t)) (if (nlistp seq) ;; If SEQ isn't a list, there's no need to copy SEQ because diff --git a/src/fns.c b/src/fns.c index b193ad648a9..766e767e123 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1867,7 +1867,8 @@ If SEQ is not a list, deletion is never performed destructively; instead this function creates and returns a new vector or string. Write `(setq foo (delete element foo))' to be sure of correctly -changing the value of a sequence `foo'. */) +changing the value of a sequence `foo'. See also `remove', which +does not modify the argument. */) (Lisp_Object elt, Lisp_Object seq) { if (VECTORP (seq))