From e08efecd96bbe1fa15fc0d94f631acadef6566de Mon Sep 17 00:00:00 2001 From: Jens Schmidt Date: Sun, 25 Jan 2026 13:57:21 +0100 Subject: [PATCH] Improve documentation of 'seq-difference' * doc/lispref/sequences.texi (Sequence Functions): * lisp/emacs-lisp/seq.el (seq-difference): Clarify the documentation of 'seq-difference'. (Bug#80257) --- 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 853b577c910..afee255346c 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -1125,10 +1125,11 @@ two arguments to use to compare elements instead of the default @defun seq-difference sequence1 sequence2 &optional function - This function returns a list of the elements that appear in -@var{sequence1} but not in @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} were 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 881fae951b6..e0a41b380b5 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -579,7 +579,7 @@ This does not modify SEQUENCE1 or SEQUENCE2." '())) (cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) - "Return list of all the elements that appear in SEQUENCE1 but not in 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."