diff lisp/help.el @ 4642:48b45a606961

Support #'function-arglist with built-in special forms. Also fix a couple of bugs in lisp/help.el. lisp/ChangeLog addition: 2009-06-14 Aidan Kehoe <kehoea@parhasard.net> * help.el (describe-function-1): Check macro-p, not macrop, when describing whether a symbol has an associated macro or an associated function. Relevant with autoloaded macros. (function-arglist): Accept multi-line arglists in built-in functions, as found in #'write-region-internal. #'dontusethis-set-symbol-value-handler is still broken for other reasons. src/ChangeLog addition: 2009-06-14 Aidan Kehoe <kehoea@parhasard.net> * eval.c (For): * eval.c (Fand): * eval.c (Fif): * eval.c (Fwhen): * eval.c (Fcond): * eval.c (Fprogn): * eval.c (Fprog1): * eval.c (Fprog2): * eval.c (FletX): * eval.c (Flet): * eval.c (Fwhile): * eval.c (Fdefvar): * eval.c (Fdefconst): * eval.c (Frun_hooks): * eval.c (Frun_hooks_with_args): * eval.c (Frun_hooks_with_args_until_success): * eval.c (Frun_hooks_with_args_until_failure): Add arguments information, understood by #'function-arglist, to all these special forms, functions and macros. Remove the argument information that was already there that was not understood by #'function-arglist.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 14 Jun 2009 15:07:13 +0100
parents 7c7262c47538
children e9b88e997479
line wrap: on
line diff
--- a/lisp/help.el	Sun Jun 07 16:47:04 2009 +0100
+++ b/lisp/help.el	Sun Jun 14 15:07:13 2009 +0100
@@ -1192,9 +1192,12 @@
 		 (let* ((doc (documentation function))
 			(args (and doc
 				   (string-match
-				    "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'"
+				    "[\n\t ]*\narguments: ?(\\([^)]*\\))\n?\\'"
 				    doc)
-				   (match-string 1 doc))))
+				   (match-string 1 doc)))
+                        (args (and args (replace-in-string args
+                                                           "[ ]*\\\\\n[ ]*"
+                                                           " " t))))
 		   ;; If there are no arguments documented for the
 		   ;; subr, rather don't print anything.
 		   (cond ((null args) t)
@@ -1402,7 +1405,7 @@
                                      (cond
                                       ((eq 'neither macro-p)
                                        "")
-                                      (macrop " macro")
+                                      (macro-p " macro")
                                       (t " function"))))
 			   string)))))
       (cond ((or (stringp def) (vectorp def))