mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-22 18:35:09 +00:00
(functionp): Return nil for special forms.
This commit is contained in:
parent
0e96e25f47
commit
fc944cd4c5
@ -116,9 +116,7 @@ byte compiler. @xref{Byte-Code Type}.
|
||||
|
||||
@defun functionp object
|
||||
This function returns @code{t} if @var{object} is any kind of
|
||||
function, or a special form, or, recursively, a symbol whose function
|
||||
definition is a function or special form. (This does not include
|
||||
macros.)
|
||||
function, i.e. can be passed to @code{funcall}.
|
||||
@end defun
|
||||
|
||||
Unlike @code{functionp}, the next three functions do @emph{not}
|
||||
|
3
etc/NEWS
3
etc/NEWS
@ -654,6 +654,9 @@ for the list of extra keys that are available.
|
||||
|
||||
* Incompatible Lisp Changes in Emacs 23.1
|
||||
|
||||
** `functionp' returns nil for special forms.
|
||||
I.e. it only returns t for objects that can be passed `funcall'.
|
||||
|
||||
+++
|
||||
** The multibyteness of process filters is determined by the coding-system
|
||||
used for decoding. The functions `process-filter-multibyte-p' and
|
||||
|
@ -1,3 +1,7 @@
|
||||
2008-04-05 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* subr.el (functionp): Return nil for special forms.
|
||||
|
||||
2008-04-05 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* emacs-lisp/autoload.el (autoload-ensure-default-file):
|
||||
|
10
lisp/subr.el
10
lisp/subr.el
@ -231,17 +231,17 @@ configuration."
|
||||
(eq (car object) 'frame-configuration)))
|
||||
|
||||
(defun functionp (object)
|
||||
"Non-nil if OBJECT is any kind of function or a special form.
|
||||
Also non-nil if OBJECT is a symbol and its function definition is
|
||||
\(recursively) a function or special form. This does not include
|
||||
macros."
|
||||
"Non-nil if OBJECT is a function."
|
||||
(or (and (symbolp object) (fboundp object)
|
||||
(condition-case nil
|
||||
(setq object (indirect-function object))
|
||||
(error nil))
|
||||
(eq (car-safe object) 'autoload)
|
||||
(not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object)))))))
|
||||
(subrp object) (byte-code-function-p object)
|
||||
(and (subrp object)
|
||||
;; Filter out special forms.
|
||||
(not (eq 'unevalled (cdr (subr-arity object)))))
|
||||
(byte-code-function-p object)
|
||||
(eq (car-safe object) 'lambda)))
|
||||
|
||||
;;;; List functions.
|
||||
|
Loading…
Reference in New Issue
Block a user