changeset 4595:a1a8728fec10

Distinguish between special forms and subrs, #'describe-function-1. lisp/ChangeLog addition: 2009-02-04 Aidan Kehoe <kehoea@parhasard.net> * help.el (describe-function-1): Distinguish between special forms and subrs; don't bind autoload-file, #'symbol-file returns it like any other function file name.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 04 Feb 2009 11:38:25 +0000
parents 2986723ac32d
children 4fc32a3a086e
files lisp/ChangeLog lisp/help.el
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Feb 02 23:31:09 2009 +0900
+++ b/lisp/ChangeLog	Wed Feb 04 11:38:25 2009 +0000
@@ -1,3 +1,10 @@
+2009-02-04  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* help.el (describe-function-1): 
+	Distinguish between special forms and subrs; don't bind
+	autoload-file, #'symbol-file returns it like any other function
+	file name.
+
 2009-01-31  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* mule/mule-cmds.el (finish-set-language-environment): 
--- a/lisp/help.el	Mon Feb 02 23:31:09 2009 +0900
+++ b/lisp/help.el	Wed Feb 04 11:38:25 2009 +0000
@@ -1371,7 +1371,7 @@
   (princ function)
   (princ "' is ")
   (let* ((def function)
-	 aliases file-name autoload-file kbd-macro-p fndef macrop)
+	 aliases file-name kbd-macro-p fndef macrop)
     (while (and (symbolp def) (fboundp def))
       (when (not (eq def function))
 	(setq aliases
@@ -1403,11 +1403,17 @@
 					   (an-p "an ")
 					   (t "a "))
 				     "%s"
-				     (if macro-p " macro" " function")))
+                                     (cond
+                                      ((eq 'neither macro-p)
+                                       "")
+                                      (macrop " macro")
+                                      (t " function"))))
 			   string)))))
       (cond ((or (stringp def) (vectorp def))
              (princ "a keyboard macro.")
 	     (setq kbd-macro-p t))
+            ((special-form-p fndef)
+             (funcall int "built-in special form" nil 'neither))
             ((subrp fndef)
              (funcall int "built-in" nil macrop))
             ((compiled-function-p fndef)
@@ -1417,7 +1423,6 @@
             ((eq (car-safe fndef) 'mocklisp)
              (funcall int "mocklisp" nil macrop))
             ((eq (car-safe def) 'autoload)
-	     (setq autoload-file (elt def 1))
 	     (funcall int "autoloaded Lisp" t (elt def 4)))
 	    ((and (symbolp def) (not (fboundp def)))
 	     (princ "a symbol with a void (unbound) function definition."))