]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove eieio's ...-list-p predicate (bug#78782)
authorPip Cet <pipcet@protonmail.com>
Wed, 18 Jun 2025 11:39:17 +0000 (11:39 +0000)
committerEshel Yaron <me@eshelyaron.com>
Sun, 22 Jun 2025 07:49:25 +0000 (09:49 +0200)
There seem to be no remaining callers of this function, which has not
been working for a while.

* lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): Don't
mention "-list-p" predicate.
(eieio-defclass-autoload): Don't autoload predicate.
(eieio-defclass-internal): Remove code to generate list-p predicate.

(cherry picked from commit af68c6e82556901b1d80600ee1cc5c785136e47b)

lisp/emacs-lisp/eieio-core.el

index a06c36e5b72335f96486cb34fb9c102d8d88b2ed..72640e88301e1710057926d6bd2d6b7de24626a1 100644 (file)
@@ -67,7 +67,7 @@ default setting for optimization purposes.")
   "If nil, drop support for some behaviors of older versions of EIEIO.
 Currently under control of this var:
 - Define every class as a var whose value is the class symbol.
-- Define <class>-child-p and <class>-list-p predicates.
+- Define <class>-child-p predicate.
 - Allow object names in constructors.
 When `warn', also emit warnings at run-time when code uses those
 deprecated features.")
@@ -224,8 +224,7 @@ It creates an autoload function for CNAME's constructor."
       (autoload cname filename doc nil nil)
       (autoload (intern (format "%s-p" cname)) filename "" nil nil)
       (when eieio-backward-compatibility
-        (autoload (intern (format "%s-child-p" cname)) filename "" nil nil)
-        (autoload (intern (format "%s-list-p" cname)) filename "" nil nil)))))
+        (autoload (intern (format "%s-child-p" cname)) filename "" nil nil)))))
 
 (defun eieio--full-class-object (class)
   "Like `eieio--class-object' but loads the class if needed."
@@ -352,31 +351,6 @@ See `defclass' for more information."
       (make-obsolete-variable cname (format "use '%s instead" cname)
                               "25.1"))
 
-    ;; Create a handy list of the class test too
-    (when eieio-backward-compatibility
-      (let ((csym (intern (concat (symbol-name cname) "-list-p"))))
-        (defalias csym
-          (lambda (obj)
-            (:documentation
-             (internal--format-docstring-line
-              "Test OBJ to see if it a list of objects which are a child of type `%s'."
-              cname))
-            (when (eq eieio-backward-compatibility 'warn)
-              (message "Use of obsolete function %S" csym))
-            (when (listp obj)
-              (let ((ans t)) ;; nil is valid
-                ;; Loop over all the elements of the input list, test
-                ;; each to make sure it is a child of the desired object class.
-                (while (and obj ans)
-                  (setq ans (and (eieio-object-p (car obj))
-                                 (object-of-class-p (car obj) 'cname)))
-                  (setq obj (cdr obj)))
-                ans))))
-        (make-obsolete csym (format
-                             "use (cl-typep ... '(list-of %s)) instead"
-                             cname)
-                       "25.1")))
-
     ;; Store the new class vector definition into the symbol.  We need to
     ;; do this first so that we can call defmethod for the accessor.
     ;; The vector will be updated by the following while loop and will not