From: Lars Ingebrigtsen Date: Fri, 30 Jul 2021 11:13:46 +0000 (+0200) Subject: Work around long-standing seq.el compilation warning X-Git-Tag: emacs-28.0.90~1653 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4053bd5201252850aa816150925aa256e5ab7238;p=emacs.git 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.) --- diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 6c15463ad52..e8fc4a28145 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -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.