From 4053bd5201252850aa816150925aa256e5ab7238 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Jul 2021 13:13:46 +0200 Subject: [PATCH] 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.) --- lisp/emacs-lisp/seq.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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. -- 2.39.2