Subject: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew

From: Arash Esbati <[email-masked]>
Date: Sat, 27 Jul 2024 23:25:14 +0200

Tassilo Horn <[email-masked]> writes:

> Let's just require cl-lib.  declare-function only silences the
> byte-compiler and the usage of cl-member at runtime is a fact; no
> cheating allowed.  It's also an implementation detail we should not
> bother with.

I'm not sure if this is cheating, but I'm easy, and if we want to
require cl-lib, I'd do it in tex.el which is loaded by all
<mode-name>.el files; so basically:

--8<---------------cut here---------------start------------->8---
diff --git a/tex-info.el b/tex-info.el
index dc69762e..4ae14401 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -24,9 +24,6 @@

 ;;; Code:

-(eval-when-compile
-  (require 'cl-lib))
-
 (require 'tex)

 (require 'texinfo)
diff --git a/tex.el b/tex.el
index e67d2059..729e4db2 100644
--- a/tex.el
+++ b/tex.el
@@ -33,8 +33,8 @@

 (require 'custom)
 (require 'tex-site)
+(require 'cl-lib)
 (eval-when-compile
-  (require 'cl-lib)
   (require 'subr-x))
 (require 'texmathp)
 ;; seq.el is preloaded in Emacs 29, so the next form can be removed
--8<---------------cut here---------------end--------------->8---

(plus some more changes to come).

> Tomorrow, Stefan might have optimized it to use some cl-memql-1-wazzup
> for the specific case we have here. :-)

I will not put my money on another bet :)

Best, Arash