# HG changeset patch # User Aidan Kehoe # Date 1262305267 0 # Node ID 084056f467551971aa189fe99c25b375611b7590 # Parent 8484c6c7683783363f00ae3fa61798a445fec17f #'functionp gives nil for special forms, as in CL and GNU Emacs 23. src/ChangeLog addition: 2009-12-31 Aidan Kehoe * eval.c (Ffunctionp): Special forms no longer give t in this function, in accordance with recent GNU Emacs and with Common Lisp. tests/ChangeLog addition: 2010-01-01 Aidan Kehoe * automated/lisp-tests.el: Test #'functionp, making sure it gives nil for special forms. diff -r 8484c6c76837 -r 084056f46755 src/ChangeLog --- a/src/ChangeLog Thu Dec 31 15:47:03 2009 +0000 +++ b/src/ChangeLog Fri Jan 01 00:21:07 2010 +0000 @@ -1,3 +1,9 @@ +2009-12-31 Aidan Kehoe + + * eval.c (Ffunctionp): + Special forms no longer give t in this function, in accordance + with recent GNU Emacs and with Common Lisp. + 2009-12-21 Jerry James * config.h.in: Remove OffiX support. diff -r 8484c6c76837 -r 084056f46755 src/eval.c --- a/src/eval.c Thu Dec 31 15:47:03 2009 +0000 +++ b/src/eval.c Fri Jan 01 00:21:07 2010 +0000 @@ -4144,7 +4144,9 @@ if (SYMBOLP (object)) object = indirect_function (object, 0); - if (COMPILED_FUNCTIONP (object) || SUBRP (object)) + if (COMPILED_FUNCTIONP (object) + || (SUBRP (object) + && (XSUBR (object)->max_args != UNEVALLED))) return Qt; if (CONSP (object)) { @@ -4152,7 +4154,8 @@ if (EQ (car, Qlambda)) return Qt; if (EQ (car, Qautoload) - && NILP (Fcar_safe (Fcdr_safe (Fcdr_safe (Fcdr_safe (XCDR (object))))))) + && NILP (Fcar_safe (Fcdr_safe(Fcdr_safe + (Fcdr_safe (XCDR (object))))))) return Qt; } return Qnil; diff -r 8484c6c76837 -r 084056f46755 tests/ChangeLog --- a/tests/ChangeLog Thu Dec 31 15:47:03 2009 +0000 +++ b/tests/ChangeLog Fri Jan 01 00:21:07 2010 +0000 @@ -1,3 +1,8 @@ +2010-01-01 Aidan Kehoe + + * automated/lisp-tests.el: + Test #'functionp, making sure it gives nil for special forms. + 2009-12-31 Aidan Kehoe * automated/lisp-tests.el: diff -r 8484c6c76837 -r 084056f46755 tests/automated/lisp-tests.el --- a/tests/automated/lisp-tests.el Thu Dec 31 15:47:03 2009 +0000 +++ b/tests/automated/lisp-tests.el Fri Jan 01 00:21:07 2010 +0000 @@ -2162,4 +2162,23 @@ ;; development on equalp should still run them, though. Aidan Kehoe, Thu Dec ;; 31 14:53:52 GMT 2009. +(loop + for special-form in '(multiple-value-call setq-default quote throw + save-current-buffer and or) + with not-special-form = nil + do + (Assert (special-form-p special-form) + (format "checking %S is a special operator" special-form)) + (setq not-special-form + (intern (format "%s-gMAu" (symbol-name special-form)))) + (Assert (not (special-form-p not-special-form)) + (format "checking %S is a special operator" special-form)) + (Assert (not (functionp special-form)) + (format "checking %S is not a function" special-form))) + +(loop + for real-function in '(find-file quote-maybe + - find-file-read-only) + do (Assert (functionp real-function) + (format "checking %S is a function" real-function))) + ;;; end of lisp-tests.el