aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2008-04-05 20:22:22 +0000
committerStefan Monnier2008-04-05 20:22:22 +0000
commitfc944cd4c504178b0e79f0e443650b07ba38fd6d (patch)
tree7fbd8d918b1ed5168bdbc8bd9cd1c74cdf8a9c5f /lisp
parent0e96e25f477dd68d9cc1e734b85e0123984f30e9 (diff)
downloademacs-fc944cd4c504178b0e79f0e443650b07ba38fd6d.tar.gz
emacs-fc944cd4c504178b0e79f0e443650b07ba38fd6d.zip
(functionp): Return nil for special forms.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/subr.el10
2 files changed, 9 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7f858a3f98f..15af42d6fc7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12008-04-05 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * subr.el (functionp): Return nil for special forms.
4
12008-04-05 Glenn Morris <rgm@gnu.org> 52008-04-05 Glenn Morris <rgm@gnu.org>
2 6
3 * emacs-lisp/autoload.el (autoload-ensure-default-file): 7 * emacs-lisp/autoload.el (autoload-ensure-default-file):
diff --git a/lisp/subr.el b/lisp/subr.el
index a8fcfb67bb4..94ee316f9f4 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -231,17 +231,17 @@ configuration."
231 (eq (car object) 'frame-configuration))) 231 (eq (car object) 'frame-configuration)))
232 232
233(defun functionp (object) 233(defun functionp (object)
234 "Non-nil if OBJECT is any kind of function or a special form. 234 "Non-nil if OBJECT is a function."
235Also non-nil if OBJECT is a symbol and its function definition is
236\(recursively) a function or special form. This does not include
237macros."
238 (or (and (symbolp object) (fboundp object) 235 (or (and (symbolp object) (fboundp object)
239 (condition-case nil 236 (condition-case nil
240 (setq object (indirect-function object)) 237 (setq object (indirect-function object))
241 (error nil)) 238 (error nil))
242 (eq (car-safe object) 'autoload) 239 (eq (car-safe object) 'autoload)
243 (not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object))))))) 240 (not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object)))))))
244 (subrp object) (byte-code-function-p object) 241 (and (subrp object)
242 ;; Filter out special forms.
243 (not (eq 'unevalled (cdr (subr-arity object)))))
244 (byte-code-function-p object)
245 (eq (car-safe object) 'lambda))) 245 (eq (car-safe object) 'lambda)))
246 246
247;;;; List functions. 247;;;; List functions.