1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Work around long-standing seq.el compilation warning

* lisp/emacs-lisp/seq.el (seq-contains): When using cl-defgeneric
to define an obsolete function, it'll complain about it being
obsolete.  Suppress that warning.  (Should probably be fixed in
cl-defgeneric instead.)
This commit is contained in:
Lars Ingebrigtsen 2021-07-30 13:13:46 +02:00
parent 97894b07c2
commit 4053bd5201

View file

@ -394,14 +394,15 @@ found or not."
(setq count (+ 1 count))))
count))
(cl-defgeneric seq-contains (sequence elt &optional testfn)
"Return the first element in SEQUENCE that is equal to ELT.
(with-suppressed-warnings ((obsolete seq-contains))
(cl-defgeneric seq-contains (sequence elt &optional testfn)
"Return the first element in SEQUENCE that is equal to ELT.
Equality is defined by TESTFN if non-nil or by `equal' if nil."
(declare (obsolete seq-contains-p "27.1"))
(seq-some (lambda (e)
(when (funcall (or testfn #'equal) elt e)
e))
sequence))
(declare (obsolete seq-contains-p "27.1"))
(seq-some (lambda (e)
(when (funcall (or testfn #'equal) elt e)
e))
sequence)))
(cl-defgeneric seq-contains-p (sequence elt &optional testfn)
"Return non-nil if SEQUENCE contains an element equal to ELT.