diff options
| author | Stefan Monnier | 2002-09-27 23:03:17 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-09-27 23:03:17 +0000 |
| commit | 890df022a2ba11447788f98c3522fca911c14fb4 (patch) | |
| tree | 79140860fecefaaef07f96844664d593f291eabe | |
| parent | bbb7041afb98ae8361992177d451eb714d9c163a (diff) | |
| download | emacs-890df022a2ba11447788f98c3522fca911c14fb4.tar.gz emacs-890df022a2ba11447788f98c3522fca911c14fb4.zip | |
(make-autoload): Add usage info to docstring.
(autoload-print-form): Also quote open-[-in-column 0.
| -rw-r--r-- | lisp/emacs-lisp/autoload.el | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 9633f3ea85e..27b24e64210 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | ;;; Code: | 33 | ;;; Code: |
| 34 | 34 | ||
| 35 | (require 'lisp-mode) ;for `doc-string-elt' properties. | 35 | (require 'lisp-mode) ;for `doc-string-elt' properties. |
| 36 | 36 | (require 'help-fns) ;for help-add-fundoc-usage. | |
| 37 | 37 | ||
| 38 | (defvar generated-autoload-file "loaddefs.el" | 38 | (defvar generated-autoload-file "loaddefs.el" |
| 39 | "*File \\[update-file-autoloads] puts autoloads into. | 39 | "*File \\[update-file-autoloads] puts autoloads into. |
| @@ -90,8 +90,14 @@ or macro definition or a defcustom)." | |||
| 90 | define-minor-mode defun* defmacro*)) | 90 | define-minor-mode defun* defmacro*)) |
| 91 | (let* ((macrop (memq car '(defmacro defmacro*))) | 91 | (let* ((macrop (memq car '(defmacro defmacro*))) |
| 92 | (name (nth 1 form)) | 92 | (name (nth 1 form)) |
| 93 | (args (if (memq car '(defun defmacro defun* defmacro*)) | ||
| 94 | (nth 2 form) t)) | ||
| 93 | (body (nthcdr (get car 'doc-string-elt) form)) | 95 | (body (nthcdr (get car 'doc-string-elt) form)) |
| 94 | (doc (if (stringp (car body)) (pop body)))) | 96 | (doc (if (stringp (car body)) (pop body)))) |
| 97 | (when (listp args) | ||
| 98 | ;; Add the usage form at the end where describe-function-1 | ||
| 99 | ;; can recover it. | ||
| 100 | (setq doc (help-add-fundoc-usage doc args))) | ||
| 95 | ;; `define-generic-mode' quotes the name, so take care of that | 101 | ;; `define-generic-mode' quotes the name, so take care of that |
| 96 | (list 'autoload (if (listp name) name (list 'quote name)) file doc | 102 | (list 'autoload (if (listp name) name (list 'quote name)) file doc |
| 97 | (or (and (memq car '(define-skeleton define-derived-mode | 103 | (or (and (memq car '(define-skeleton define-derived-mode |
| @@ -121,10 +127,10 @@ or macro definition or a defcustom)." | |||
| 121 | ;; nil here indicates that this is not a special autoload form. | 127 | ;; nil here indicates that this is not a special autoload form. |
| 122 | (t nil)))) | 128 | (t nil)))) |
| 123 | 129 | ||
| 124 | ;;; Forms which have doc-strings which should be printed specially. | 130 | ;; Forms which have doc-strings which should be printed specially. |
| 125 | ;;; A doc-string-elt property of ELT says that (nth ELT FORM) is | 131 | ;; A doc-string-elt property of ELT says that (nth ELT FORM) is |
| 126 | ;;; the doc-string in FORM. | 132 | ;; the doc-string in FORM. |
| 127 | ;;; Those properties are now set in lisp-mode.el. | 133 | ;; Those properties are now set in lisp-mode.el. |
| 128 | 134 | ||
| 129 | 135 | ||
| 130 | (defun autoload-trim-file-name (file) | 136 | (defun autoload-trim-file-name (file) |
| @@ -191,7 +197,7 @@ markers before we call `read'." | |||
| 191 | ;; the doc string. | 197 | ;; the doc string. |
| 192 | (with-current-buffer outbuf | 198 | (with-current-buffer outbuf |
| 193 | (save-excursion | 199 | (save-excursion |
| 194 | (while (search-backward "\n(" begin t) | 200 | (while (re-search-backward "\n[[(]" begin t) |
| 195 | (forward-char 1) | 201 | (forward-char 1) |
| 196 | (insert "\\")))) | 202 | (insert "\\")))) |
| 197 | (if (null (cdr elt)) | 203 | (if (null (cdr elt)) |