(generate-file-autoloads): Undo previous change
because make-docfile requires defvar doc string to start on first line.
This commit is contained in:
parent
590cc44988
commit
c751663136
1 changed files with 37 additions and 68 deletions
|
@ -146,83 +146,52 @@ are used."
|
||||||
(setq done-any t)
|
(setq done-any t)
|
||||||
(if (eolp)
|
(if (eolp)
|
||||||
;; Read the next form and make an autoload.
|
;; Read the next form and make an autoload.
|
||||||
(let* ((before (point))
|
(let* ((form (prog1 (read (current-buffer))
|
||||||
(form (prog1 (read (current-buffer))
|
|
||||||
(forward-line 1)))
|
(forward-line 1)))
|
||||||
(autoload (make-autoload form load-name))
|
(autoload (make-autoload form load-name))
|
||||||
(doc-string-elt (get (car-safe form)
|
(doc-string-elt (get (car-safe form)
|
||||||
'doc-string-elt)))
|
'doc-string-elt)))
|
||||||
(if (null autoload)
|
(if autoload
|
||||||
;; We are copying a defvar or defconst form.
|
(setq autoloads-done (cons (nth 1 form)
|
||||||
;; Copy the text instead of printing the form,
|
autoloads-done))
|
||||||
;; so as to preserve the original formatting.
|
(setq autoload form))
|
||||||
(let ((inbuf (current-buffer))
|
(if (and doc-string-elt
|
||||||
(after (point)))
|
(stringp (nth doc-string-elt autoload)))
|
||||||
(save-excursion
|
;; We need to hack the printing because the
|
||||||
(set-buffer outbuf)
|
;; doc-string must be printed specially for
|
||||||
;; Insert the form.
|
;; make-docfile (sigh).
|
||||||
(insert-buffer-substring inbuf before after)
|
(let* ((p (nthcdr (1- doc-string-elt)
|
||||||
(and doc-string-elt
|
autoload))
|
||||||
(stringp (nth doc-string-elt form))
|
(elt (cdr p)))
|
||||||
;; The form has a docstring.
|
(setcdr p nil)
|
||||||
;; Hack it for make-docfile.
|
(princ "\n(" outbuf)
|
||||||
(save-excursion
|
(mapcar (function (lambda (elt)
|
||||||
;; Move point back to FORM's start.
|
(prin1 elt outbuf)
|
||||||
(backward-char (- after before))
|
(princ " " outbuf)))
|
||||||
(skip-chars-forward " \t\n")
|
autoload)
|
||||||
(or (looking-at "(")
|
(princ "\"\\\n" outbuf)
|
||||||
(error "expected ("))
|
(princ (substring
|
||||||
(forward-char 1) ; Skip the paren.
|
(prin1-to-string (car elt)) 1)
|
||||||
;; Skip sexps before the docstring.
|
outbuf)
|
||||||
(forward-sexp doc-string-elt)
|
(if (null (cdr elt))
|
||||||
(skip-chars-forward " \t")
|
(princ ")" outbuf)
|
||||||
(if (eolp) (delete-char 1))
|
(princ " " outbuf)
|
||||||
(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.
|
|
||||||
(setq autoloads-done (cons (nth 1 form)
|
|
||||||
autoloads-done))
|
|
||||||
(if (and doc-string-elt
|
|
||||||
(stringp (nth doc-string-elt autoload)))
|
|
||||||
;; We need to hack the printing because the
|
|
||||||
;; doc-string must be printed specially for
|
|
||||||
;; make-docfile (sigh).
|
|
||||||
(let* ((p (nthcdr (1- doc-string-elt)
|
|
||||||
autoload))
|
|
||||||
(elt (cdr p)))
|
|
||||||
(setcdr p nil)
|
|
||||||
(princ "\n(" outbuf)
|
|
||||||
(mapcar (function (lambda (elt)
|
|
||||||
(prin1 elt outbuf)
|
|
||||||
(princ " " outbuf)))
|
|
||||||
autoload)
|
|
||||||
(princ "\"\\\n" outbuf)
|
|
||||||
(princ (substring
|
(princ (substring
|
||||||
(prin1-to-string (car elt)) 1)
|
(prin1-to-string (cdr elt))
|
||||||
outbuf)
|
1)
|
||||||
(if (null (cdr elt))
|
outbuf))
|
||||||
(princ ")" outbuf)
|
(terpri outbuf))
|
||||||
(princ " " outbuf)
|
(print autoload outbuf)))
|
||||||
(princ (substring
|
|
||||||
(prin1-to-string (cdr elt))
|
|
||||||
1)
|
|
||||||
outbuf))
|
|
||||||
(terpri outbuf))
|
|
||||||
(print autoload outbuf))))
|
|
||||||
;; Copy the rest of the line to the output.
|
;; Copy the rest of the line to the output.
|
||||||
(let ((begin (point)))
|
(let ((begin (point)))
|
||||||
(forward-line 1)
|
(forward-line 1)
|
||||||
(princ (buffer-substring begin (point)) outbuf))))
|
(princ (buffer-substring begin (point)) outbuf))))
|
||||||
((looking-at ";")
|
((looking-at ";")
|
||||||
;; Don't read the comment.
|
;; Don't read the comment.
|
||||||
(forward-line 1))
|
(forward-line 1))
|
||||||
(t
|
(t
|
||||||
(forward-sexp 1)
|
(forward-sexp 1)
|
||||||
(forward-line 1)))))))
|
(forward-line 1)))))))
|
||||||
(or visited
|
(or visited
|
||||||
;; We created this buffer, so we should kill it.
|
;; We created this buffer, so we should kill it.
|
||||||
(kill-buffer (current-buffer)))
|
(kill-buffer (current-buffer)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue