aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-12-07 21:31:58 +0000
committerRichard M. Stallman2002-12-07 21:31:58 +0000
commit4a3c5b3af93caba2d1e1a945e6784436e4246cd3 (patch)
tree9231a2796c0f58f5de212afc53dd01bcaa6e82ba
parente0dfc625b57646bdc9c4cc5d51df0f6551647ef6 (diff)
downloademacs-4a3c5b3af93caba2d1e1a945e6784436e4246cd3.tar.gz
emacs-4a3c5b3af93caba2d1e1a945e6784436e4246cd3.zip
(autoload-print-form-outbuf): New variable.
(autoload-print-form): Use autoload-print-form-outbuf. (generate-file-autoloads): Bind autoload-print-form-outbuf.
-rw-r--r--lisp/emacs-lisp/autoload.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 2dd909681ca..497103c5248 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -164,16 +164,20 @@ markers before we call `read'."
164 (goto-char (point-min)) 164 (goto-char (point-min))
165 (read (current-buffer)))))) 165 (read (current-buffer))))))
166 166
167;; !! Requires OUTBUF to be bound !! 167(defvar autoload-print-form-outbuf)
168
168(defun autoload-print-form (form) 169(defun autoload-print-form (form)
169 "Print FORM such that make-docfile will find the docstrings." 170 "Print FORM such that `make-docfile' will find the docstrings.
171The variable `autoload-print-form-outbuf' specifies the buffer to
172put the output in."
170 (cond 173 (cond
171 ;; If the form is a sequence, recurse. 174 ;; If the form is a sequence, recurse.
172 ((eq (car form) 'progn) (mapcar 'autoload-print-form (cdr form))) 175 ((eq (car form) 'progn) (mapcar 'autoload-print-form (cdr form)))
173 ;; Symbols at the toplevel are meaningless. 176 ;; Symbols at the toplevel are meaningless.
174 ((symbolp form) nil) 177 ((symbolp form) nil)
175 (t 178 (t
176 (let ((doc-string-elt (get (car-safe form) 'doc-string-elt))) 179 (let ((doc-string-elt (get (car-safe form) 'doc-string-elt))
180 (outbuf autoload-print-form-outbuf))
177 (if (and doc-string-elt (stringp (nth doc-string-elt form))) 181 (if (and doc-string-elt (stringp (nth doc-string-elt form)))
178 ;; We need to hack the printing because the 182 ;; We need to hack the printing because the
179 ;; doc-string must be printed specially for 183 ;; doc-string must be printed specially for
@@ -317,7 +321,8 @@ are used."
317 (setq autoloads-done (cons (nth 1 form) 321 (setq autoloads-done (cons (nth 1 form)
318 autoloads-done)) 322 autoloads-done))
319 (setq autoload form)) 323 (setq autoload form))
320 (autoload-print-form autoload)) 324 (let ((autoload-print-form-outbuf outbuf))
325 (autoload-print-form autoload)))
321 326
322 ;; Copy the rest of the line to the output. 327 ;; Copy the rest of the line to the output.
323 (princ (buffer-substring 328 (princ (buffer-substring