From 368c86bab4bc208c7ec33df253b850dcc91e4ea1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 6 Dec 2025 12:57:32 +0200 Subject: [PATCH] Improve documentation of 'seq-intersection' * doc/lispref/sequences.texi (Sequence Functions): * lisp/emacs-lisp/seq.el (seq-intersection): Clarify the documentation of 'seq-intersection'. (Bug#79844) --- doc/lispref/sequences.texi | 9 +++++---- lisp/emacs-lisp/seq.el | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 2f7c6876a8f..2b1db79e07b 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -1109,10 +1109,11 @@ instead of the default @code{equal}. @defun seq-intersection sequence1 sequence2 &optional function @cindex sequences, intersection of @cindex intersection of sequences - This function returns a list of the elements that appear both in -@var{sequence1} and @var{sequence2}. If the optional argument -@var{function} is non-@code{nil}, it is a function of two arguments to -use to compare elements instead of the default @code{equal}. + This function returns a copy of @var{sequence1} from which the +elements that appear in @var{sequence2} where removed. If the optional +argument @var{function} is non-@code{nil}, it is a function of two +arguments to use to compare elements instead of the default +@code{equal}. @example @group diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 4713deea750..38aaeba7c9b 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -567,7 +567,7 @@ This does not modify SEQUENCE1 or SEQUENCE2." ;;;###autoload (cl-defgeneric seq-intersection (sequence1 sequence2 &optional testfn) - "Return a list of all the elements that appear in both SEQUENCE1 and SEQUENCE2. + "Return copy of SEQUENCE1 with elements that appear in SEQUENCE2 removed. \"Equality\" of elements is defined by the function TESTFN, which defaults to `equal'. This does not modify SEQUENCE1 or SEQUENCE2."