emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e5d824b632a: cl-preloaded.el: Partly revert last change


From: Stefan Monnier
Subject: master e5d824b632a: cl-preloaded.el: Partly revert last change
Date: Tue, 26 Mar 2024 17:27:38 -0400 (EDT)

branch: master
commit e5d824b632a68430535f6e94d911871eb0f3f772
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    cl-preloaded.el: Partly revert last change
    
    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`.
---
 lisp/emacs-lisp/cl-preloaded.el | 6 +++++-
 test/src/data-tests.el          | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el
index 6128db05c61..260478c3a39 100644
--- a/lisp/emacs-lisp/cl-preloaded.el
+++ b/lisp/emacs-lisp/cl-preloaded.el
@@ -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)
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 753d74c02ec..a1959f62fd3 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]