Mercurial > emacs
diff lisp/subr.el @ 40830:576a1771ec55
(functionp): Make work correctly for macros and unbound symbols.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 08 Nov 2001 12:08:51 +0000 |
parents | b10e7d6fb95b |
children | 33d8d61c63dd |
line wrap: on
line diff
--- a/lisp/subr.el Thu Nov 08 12:03:10 2001 +0000 +++ b/lisp/subr.el Thu Nov 08 12:08:51 2001 +0000 @@ -1534,11 +1534,16 @@ (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.