]> git.eshelyaron.com Git - emacs.git/commitdiff
(comp-known-predicates): Fix overly optimistic `functionp`
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 12 Mar 2024 12:48:09 +0000 (08:48 -0400)
committerEshel Yaron <me@eshelyaron.com>
Fri, 15 Mar 2024 08:58:15 +0000 (09:58 +0100)
* lisp/emacs-lisp/comp.el (comp-known-predicates): `functionp` can also
be true for `cons` objects.

(cherry picked from commit d5773276fb1671da619eeee2c316098d6b1c25c4)

lisp/emacs-lisp/comp.el

index 21e2bb01ed053abb1fd340ae7c77a65532bcb369..9c2182092cb9ed60d9dcf8dfc3cd8a74036669dd 100644 (file)
@@ -202,7 +202,7 @@ Useful to hook into pass checkers.")
     (consp               . cons)
     (floatp              . float)
     (framep              . frame)
-    (functionp           . (or function symbol))
+    (functionp           . (or function symbol cons))
     (hash-table-p       . hash-table)
     (integer-or-marker-p . integer-or-marker)
     (integerp            . integer)
@@ -244,6 +244,7 @@ Useful to hook into pass checkers.")
 
 (defun comp--pred-to-cstr (predicate)
   "Given PREDICATE, return the corresponding constraint."
+  ;; FIXME: Unify those two hash tables?
   (or (gethash predicate comp-known-predicates-h)
       (gethash predicate (comp-cstr-ctxt-pred-type-h comp-ctxt))))