]> git.eshelyaron.com Git - emacs.git/commit
Document cl-n... set operations consistently
authorBasil L. Contovounesios <basil@contovou.net>
Sun, 2 Feb 2025 17:05:57 +0000 (18:05 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Feb 2025 19:30:33 +0000 (20:30 +0100)
commit0f3ff462f10b3ea6746ac3791cb1f566b51fef83
treea63144dfc5003009b0af8abf84559dbe1e17e3d2
parent3b79a7279111e8fac417a2e56cf8f48491acdf29
Document cl-n... set operations consistently

The docstrings of cl-nintersection and cl-nset-difference have been
inconsistent with their manual entries since the beginning of
emacs.git history (bug#76017).  This patch settles on the weaker and
thus backward-compatible requirement that only their first argument
be safe to mutate.

* lisp/emacs-lisp/bytecomp.el: Include only first argument in
mutates-arguments property.
* lisp/emacs-lisp/cl-seq.el (cl-nintersection, cl-nset-difference):
Make docstring consistent with manual in that the second argument is
not modified.
* test/lisp/emacs-lisp/cl-seq-tests.el (cl-nintersection-test)
(cl-nset-difference-test): Simplify.
(cl-nset-difference): Pass fresh list as second argument, otherwise
destructive modifications to it could go undetected.

(cherry picked from commit ac143186c04ffd729cfe11abd99f02abdf742f64)
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/cl-seq.el
test/lisp/emacs-lisp/cl-seq-tests.el