aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2001-11-08 12:12:30 +0000
committerMiles Bader2001-11-08 12:12:30 +0000
commit1cf72ff8ebc98819b086fac1c05c8df5ad4ef240 (patch)
tree294bd2428f0c035dd6c7ef7c4950827eef183bbf
parent7c1ce64cd67f7cd7e46e8cc53a9573db7b9da04a (diff)
downloademacs-1cf72ff8ebc98819b086fac1c05c8df5ad4ef240.tar.gz
emacs-1cf72ff8ebc98819b086fac1c05c8df5ad4ef240.zip
(functionp): Make work correctly for macros and unbound symbols.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/subr.el11
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 29dae697676..93fd9913af9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12001-11-08 Miles Bader <miles@gnu.org> 12001-11-08 Miles Bader <miles@gnu.org>
2 2
3 * subr.el (functionp): Make work correctly for macros and unbound
4 symbols.
5
3 * comint.el (comint-send-input): Fix description of 6 * comint.el (comint-send-input): Fix description of
4 `comint-process-echoes' in the doc-string. 7 `comint-process-echoes' in the doc-string.
5 8
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."
1534 1534
1535(defun functionp (object) 1535(defun functionp (object)
1536 "Non-nil iff OBJECT is a type of object that can be called as a function." 1536 "Non-nil iff OBJECT is a type of object that can be called as a function."
1537 (or (and (symbolp object) (setq object (indirect-function object)) 1537 (or (and (symbolp object)
1538 (fboundp object)
1539 (setq object (indirect-function object))
1538 (eq (car-safe object) 'autoload) 1540 (eq (car-safe object) 'autoload)
1539 (not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object))))))) 1541 (not (eq (car-safe
1542 (cdr-safe (cdr-safe (cdr-safe (cdr-safe object)))))
1543 'keymap)))
1540 (subrp object) (byte-code-function-p object) 1544 (subrp object) (byte-code-function-p object)
1541 (eq (car-safe object) 'lambda))) 1545 (eq (car-safe object) 'lambda)
1546 (eq (car-safe object) 'macro)))
1542 1547
1543(defun interactive-form (function) 1548(defun interactive-form (function)
1544 "Return the interactive form of FUNCTION. 1549 "Return the interactive form of FUNCTION.