Commit c7516631 authored by Richard M. Stallman's avatar Richard M. Stallman

(generate-file-autoloads): Undo previous change

because make-docfile requires defvar doc string to start on first line.
parent 590cc449
......@@ -146,46 +146,15 @@ are used."
(setq done-any t)
(if (eolp)
;; Read the next form and make an autoload.
(let* ((before (point))
(form (prog1 (read (current-buffer))
(let* ((form (prog1 (read (current-buffer))
(forward-line 1)))
(autoload (make-autoload form load-name))
(doc-string-elt (get (car-safe form)
'doc-string-elt)))
(if (null autoload)
;; We are copying a defvar or defconst form.
;; Copy the text instead of printing the form,
;; so as to preserve the original formatting.
(let ((inbuf (current-buffer))
(after (point)))
(save-excursion
(set-buffer outbuf)
;; Insert the form.
(insert-buffer-substring inbuf before after)
(and doc-string-elt
(stringp (nth doc-string-elt form))
;; The form has a docstring.
;; Hack it for make-docfile.
(save-excursion
;; Move point back to FORM's start.
(backward-char (- after before))
(skip-chars-forward " \t\n")
(or (looking-at "(")
(error "expected ("))
(forward-char 1) ; Skip the paren.
;; Skip sexps before the docstring.
(forward-sexp doc-string-elt)
(skip-chars-forward " \t")
(if (eolp) (delete-char 1))
(skip-chars-forward " \t")
(or (looking-at "\"")
(error "expected \""))
(forward-char 1) ; Skip the ".
(insert "\\\n"))) ;make-docfile happy.
(goto-char after)))
;; Write the autoload for this defun or defmacro.
(if autoload
(setq autoloads-done (cons (nth 1 form)
autoloads-done))
(setq autoload form))
(if (and doc-string-elt
(stringp (nth doc-string-elt autoload)))
;; We need to hack the printing because the
......@@ -212,7 +181,7 @@ are used."
1)
outbuf))
(terpri outbuf))
(print autoload outbuf))))
(print autoload outbuf)))
;; Copy the rest of the line to the output.
(let ((begin (point)))
(forward-line 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment