]> git.eshelyaron.com Git - emacs.git/commitdiff
(functionp): Make work correctly for macros and unbound symbols.
authorMiles Bader <miles@gnu.org>
Thu, 8 Nov 2001 12:12:30 +0000 (12:12 +0000)
committerMiles Bader <miles@gnu.org>
Thu, 8 Nov 2001 12:12:30 +0000 (12:12 +0000)
lisp/ChangeLog
lisp/subr.el

index 29dae69767698cfa8fcc4917774d7607ee75fbc3..93fd9913af927904e1012d347c52942614e735dd 100644 (file)
@@ -1,5 +1,8 @@
 2001-11-08  Miles Bader  <miles@gnu.org>
 
+       * subr.el (functionp): Make work correctly for macros and unbound
+       symbols.
+
        * comint.el (comint-send-input): Fix description of
        `comint-process-echoes' in the doc-string.
 
index 2f9765153718ea4f86df66d0fde51acf8fe40acd..27812d690cd25777ce0a5557ee9bea9c0cbc3966 100644 (file)
@@ -1534,11 +1534,16 @@ configuration."
 
 (defun functionp (object)
   "Non-nil iff OBJECT is a type of object that can be called as a function."
-  (or (and (symbolp object) (setq object (indirect-function object))
+  (or (and (symbolp object)
+          (fboundp object)
+          (setq object (indirect-function object))
           (eq (car-safe object) 'autoload)
-          (not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object)))))))
+          (not (eq (car-safe
+                    (cdr-safe (cdr-safe (cdr-safe (cdr-safe object)))))
+                   'keymap)))
       (subrp object) (byte-code-function-p object)
-      (eq (car-safe object) 'lambda)))
+      (eq (car-safe object) 'lambda)
+      (eq (car-safe object) 'macro)))
 
 (defun interactive-form (function)
   "Return the interactive form of FUNCTION.