From: Miles Bader Date: Thu, 8 Nov 2001 12:12:30 +0000 (+0000) Subject: (functionp): Make work correctly for macros and unbound symbols. X-Git-Tag: ttn-vms-21-2-B4~18740 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1cf72ff8ebc98819b086fac1c05c8df5ad4ef240;p=emacs.git (functionp): Make work correctly for macros and unbound symbols. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29dae697676..93fd9913af9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2001-11-08 Miles Bader + * 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. diff --git a/lisp/subr.el b/lisp/subr.el index 2f976515371..27812d690cd 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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.