diff lisp/autoload.el @ 4702:eb1a409c317b

Unbreak autoload.el 2009-09-28 Mike Sperber <mike@xemacs.org> * autoload.el (make-autoload): Only try to add arguments to documentation when the form actually allows it. * cl-macs.el (cl-function-arglist): Add autoload; used in autoload.el.
author Mike Sperber <sperber@deinprogramm.de>
date Mon, 28 Sep 2009 18:04:07 +0200
parents fee33ab25966
children e29fcfd8df5f
line wrap: on
line diff
--- a/lisp/autoload.el	Sun Sep 27 20:37:44 2009 +0100
+++ b/lisp/autoload.el	Mon Sep 28 18:04:07 2009 +0200
@@ -283,17 +283,17 @@
      ((memq car autoload-make-autoload-operators)
       (let* ((macrop (memq car '(defmacro defmacro*)))
 	     (name (nth 1 form))
-             (arglist (nth 2 form))
 	     (body (nthcdr (get car 'doc-string-elt) form))
-             (placeholder (eval-when-compile (gensym)))
-             (doc (concat (if (stringp (car body))
-                              (pop body)
-                            "")
-                          "\n\narguments: "
-                          (replace-in-string
-                           (cl-function-arglist placeholder arglist)
-                           (format "^(%s ?" placeholder)
-                           "(") "\n")))
+	     (doc (if (stringp (car body)) (pop body))))
+	(if (memq car '(defmacro defmacro* defun defun*))
+	    (let ((arglist (nth 2 form))
+		  (placeholder (eval-when-compile (gensym))))
+	      (setq doc (concat (or doc "")
+				"\n\narguments: "
+				(replace-in-string
+				 (cl-function-arglist placeholder arglist)
+				 (format "^(%s ?" placeholder)
+				 "(") "\n"))))
 	;; `define-generic-mode' quotes the name, so take care of that
 	(list 'autoload (if (listp name) name (list 'quote name)) file doc
 	      (or (and (memq car '(define-skeleton define-derived-mode