diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/subr.el | 10 |
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 @@ | |||
| 1 | 2008-04-05 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * subr.el (functionp): Return nil for special forms. | ||
| 4 | |||
| 1 | 2008-04-05 Glenn Morris <rgm@gnu.org> | 5 | 2008-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." |
| 235 | Also non-nil if OBJECT is a symbol and its function definition is | ||
| 236 | \(recursively) a function or special form. This does not include | ||
| 237 | macros." | ||
| 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. |