mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Fix seq-contains
Make sure seq-contains return the element of the sequence instead of t. * lisp/emacs-lisp/seq.el (seq-contains): Fix the function. * test/lisp/emacs-lisp/seq-tests.el: Add a regression test.
This commit is contained in:
parent
2aebb0dd1f
commit
ead28454b8
2 changed files with 7 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Nicolas Petton <nicolas@petton.fr>
|
||||
;; Keywords: sequences
|
||||
;; Version: 2.17
|
||||
;; Version: 2.18
|
||||
;; Package: seq
|
||||
|
||||
;; Maintainer: emacs-devel@gnu.org
|
||||
|
|
@ -349,7 +349,8 @@ found or not."
|
|||
"Return the first element in SEQUENCE that is equal to ELT.
|
||||
Equality is defined by TESTFN if non-nil or by `equal' if nil."
|
||||
(seq-some (lambda (e)
|
||||
(funcall (or testfn #'equal) elt e))
|
||||
(when (funcall (or testfn #'equal) elt e)
|
||||
e))
|
||||
sequence))
|
||||
|
||||
(cl-defgeneric seq-position (sequence elt &optional testfn)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue