comparison 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
comparison
equal deleted inserted replaced
4701:684f0ed6cd4f 4702:eb1a409c317b
281 281
282 ;; For special function-like operators, use the `autoload' function. 282 ;; For special function-like operators, use the `autoload' function.
283 ((memq car autoload-make-autoload-operators) 283 ((memq car autoload-make-autoload-operators)
284 (let* ((macrop (memq car '(defmacro defmacro*))) 284 (let* ((macrop (memq car '(defmacro defmacro*)))
285 (name (nth 1 form)) 285 (name (nth 1 form))
286 (arglist (nth 2 form))
287 (body (nthcdr (get car 'doc-string-elt) form)) 286 (body (nthcdr (get car 'doc-string-elt) form))
288 (placeholder (eval-when-compile (gensym))) 287 (doc (if (stringp (car body)) (pop body))))
289 (doc (concat (if (stringp (car body)) 288 (if (memq car '(defmacro defmacro* defun defun*))
290 (pop body) 289 (let ((arglist (nth 2 form))
291 "") 290 (placeholder (eval-when-compile (gensym))))
292 "\n\narguments: " 291 (setq doc (concat (or doc "")
293 (replace-in-string 292 "\n\narguments: "
294 (cl-function-arglist placeholder arglist) 293 (replace-in-string
295 (format "^(%s ?" placeholder) 294 (cl-function-arglist placeholder arglist)
296 "(") "\n"))) 295 (format "^(%s ?" placeholder)
296 "(") "\n"))))
297 ;; `define-generic-mode' quotes the name, so take care of that 297 ;; `define-generic-mode' quotes the name, so take care of that
298 (list 'autoload (if (listp name) name (list 'quote name)) file doc 298 (list 'autoload (if (listp name) name (list 'quote name)) file doc
299 (or (and (memq car '(define-skeleton define-derived-mode 299 (or (and (memq car '(define-skeleton define-derived-mode
300 define-generic-mode 300 define-generic-mode
301 easy-mmode-define-global-mode 301 easy-mmode-define-global-mode