]> git.eshelyaron.com Git - emacs.git/commitdiff
cl-preloaded.el: Partly revert last change
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 26 Mar 2024 21:27:29 +0000 (17:27 -0400)
committerEshel Yaron <me@eshelyaron.com>
Wed, 27 Mar 2024 20:38:47 +0000 (21:38 +0100)
The change caused type-check errors in auth-source where they use
`:type function` constraints on object slots and expect those to
be able to hold symbols.

* lisp/emacs-lisp/cl-preloaded.el (function): Revert last change.

* test/src/data-tests.el (data-tests--cl-type-of): Use `cl-functionp`
rather than `functionp` to test `function`.

(cherry picked from commit e5d824b632a68430535f6e94d911871eb0f3f772)

lisp/emacs-lisp/cl-preloaded.el
test/src/data-tests.el

index 6128db05c616d6309e8305369e3dce8f872542a9..260478c3a392b438bab0882d40fd197f588752a1 100644 (file)
@@ -436,7 +436,11 @@ For this build of Emacs it's %dbit."
   (car car) (cdr cdr))
 (cl--define-built-in-type function (atom)
   "Abstract supertype of function values."
-  :predicate cl-functionp)
+  ;; FIXME: Historically, (cl-typep FOO 'function) called `functionp',
+  ;; so while `cl-functionp' would be the more correct predicate, it
+  ;; would breaks existing code :-(
+  ;; :predicate cl-functionp
+  )
 (cl--define-built-in-type compiled-function (function)
   "Abstract type of functions that have been compiled.")
 (cl--define-built-in-type byte-code-function (compiled-function)
index 753d74c02ec9760b60e522bf11c9832a6197b100..a1959f62fd31715f7cca56f3c375443f029d6a89 100644 (file)
@@ -870,7 +870,9 @@ comparing the subr with a much slower Lisp implementation."
                                    native-comp-unit interpreted-function
                                    tree-sitter-compiled-query
                                    tree-sitter-node tree-sitter-parser))))
-            (should-not (cl-typep val subtype))))))))
+            (cond
+             ((eq subtype 'function) (cl-functionp val))
+             (t (should-not (cl-typep val subtype))))))))))
 
 
 ;;; data-tests.el ends here