aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/functions.texi4
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/subr.el10
4 files changed, 13 insertions, 8 deletions
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 40a3d3ec38b..3a891db871e 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -116,9 +116,7 @@ byte compiler. @xref{Byte-Code Type}.
116 116
117@defun functionp object 117@defun functionp object
118This function returns @code{t} if @var{object} is any kind of 118This function returns @code{t} if @var{object} is any kind of
119function, or a special form, or, recursively, a symbol whose function 119function, i.e. can be passed to @code{funcall}.
120definition is a function or special form. (This does not include
121macros.)
122@end defun 120@end defun
123 121
124Unlike @code{functionp}, the next three functions do @emph{not} 122Unlike @code{functionp}, the next three functions do @emph{not}
diff --git a/etc/NEWS b/etc/NEWS
index 37786df831c..0e88ea6cffb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -654,6 +654,9 @@ for the list of extra keys that are available.
654 654
655* Incompatible Lisp Changes in Emacs 23.1 655* Incompatible Lisp Changes in Emacs 23.1
656 656
657** `functionp' returns nil for special forms.
658I.e. it only returns t for objects that can be passed `funcall'.
659
657+++ 660+++
658** The multibyteness of process filters is determined by the coding-system 661** The multibyteness of process filters is determined by the coding-system
659used for decoding. The functions `process-filter-multibyte-p' and 662used for decoding. The functions `process-filter-multibyte-p' and
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.