aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/autoload.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1993-06-17 06:59:49 +0000
committerRichard M. Stallman <[email protected]>1993-06-17 06:59:49 +0000
commitc751663136a7c61b1a47c45e80c60311b54ed95b (patch)
treedfd23e659355fd5f62607c5339cd0d30d710d08e /lisp/emacs-lisp/autoload.el
parent590cc44988b4ba7cd6fa8e3126d2d91c2760afd6 (diff)
(generate-file-autoloads): Undo previous change
because make-docfile requires defvar doc string to start on first line.
Diffstat (limited to 'lisp/emacs-lisp/autoload.el')
-rw-r--r--lisp/emacs-lisp/autoload.el105
1 files changed, 37 insertions, 68 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index f927c02563..b7f5dad4d3 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -146,83 +146,52 @@ 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.
- (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)
+ (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
+ ;; 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
+ (prin1-to-string (car elt)) 1)
+ outbuf)
+ (if (null (cdr elt))
+ (princ ")" outbuf)
+ (princ " " outbuf)
(princ (substring
- (prin1-to-string (car elt)) 1)
- outbuf)
- (if (null (cdr elt))
- (princ ")" outbuf)
- (princ " " outbuf)
- (princ (substring
- (prin1-to-string (cdr elt))
- 1)
- outbuf))
- (terpri outbuf))
- (print autoload outbuf))))
+ (prin1-to-string (cdr elt))
+ 1)
+ outbuf))
+ (terpri outbuf))
+ (print autoload outbuf)))
;; Copy the rest of the line to the output.
(let ((begin (point)))
(forward-line 1)
(princ (buffer-substring begin (point)) outbuf))))
- ((looking-at ";")
- ;; Don't read the comment.
- (forward-line 1))
- (t
- (forward-sexp 1)
- (forward-line 1)))))))
+ ((looking-at ";")
+ ;; Don't read the comment.
+ (forward-line 1))
+ (t
+ (forward-sexp 1)
+ (forward-line 1)))))))
(or visited
;; We created this buffer, so we should kill it.
(kill-buffer (current-buffer)))