aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1994-02-08 23:03:09 +0000
committerRoland McGrath1994-02-08 23:03:09 +0000
commit9ed4d64fd35fdcb7f177947df309c5a51ae13402 (patch)
tree600c3127870e5f86b41e3dcece10c914cd00b47d
parented9c1473199b4dba4c4c9188211cbbd189652a1b (diff)
downloademacs-9ed4d64fd35fdcb7f177947df309c5a51ae13402.tar.gz
emacs-9ed4d64fd35fdcb7f177947df309c5a51ae13402.zip
(generate-file-autoloads): Don't frob literal formfeeds into \f; just bind
print-escape-newlines to t around printing (now has same effect).
-rw-r--r--lisp/emacs-lisp/autoload.el80
1 files changed, 36 insertions, 44 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 254a7d39279..d54837374d4 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -155,38 +155,36 @@ are used."
155 (search-forward generate-autoload-cookie) 155 (search-forward generate-autoload-cookie)
156 (skip-chars-forward " \t") 156 (skip-chars-forward " \t")
157 (setq done-any t) 157 (setq done-any t)
158 (let ((begin (save-excursion (set-buffer outbuf) 158 (if (eolp)
159 (point)))) 159 ;; Read the next form and make an autoload.
160 (if (eolp) 160 (let* ((form (prog1 (read (current-buffer))
161 ;; Read the next form and make an autoload. 161 (forward-line 1)))
162 (let* ((form (prog1 (read (current-buffer)) 162 (autoload (make-autoload form load-name))
163 (forward-line 1))) 163 (doc-string-elt (get (car-safe form)
164 (autoload (make-autoload form load-name)) 164 'doc-string-elt)))
165 (doc-string-elt (get (car-safe form) 165 (if autoload
166 'doc-string-elt))) 166 (setq autoloads-done (cons (nth 1 form)
167 (if autoload 167 autoloads-done))
168 (setq autoloads-done (cons (nth 1 form) 168 (setq autoload form))
169 autoloads-done)) 169 (if (and doc-string-elt
170 (setq autoload form)) 170 (stringp (nth doc-string-elt autoload)))
171 (if (and doc-string-elt 171 ;; We need to hack the printing because the
172 (stringp (nth doc-string-elt autoload))) 172 ;; doc-string must be printed specially for
173 ;; We need to hack the printing because the 173 ;; make-docfile (sigh).
174 ;; doc-string must be printed specially for 174 (let* ((p (nthcdr (1- doc-string-elt)
175 ;; make-docfile (sigh). 175 autoload))
176 (let* ((p (nthcdr (1- doc-string-elt) 176 (elt (cdr p)))
177 autoload)) 177 (setcdr p nil)
178 (elt (cdr p))) 178 (princ "\n(" outbuf)
179 (setcdr p nil) 179 (let ((print-escape-newlines t))
180 (princ "\n(" outbuf) 180 (mapcar (function (lambda (elt)
181 (let ((print-escape-newlines t)) 181 (prin1 elt outbuf)
182 (mapcar (function (lambda (elt) 182 (princ " " outbuf)))
183 (prin1 elt outbuf) 183 autoload))
184 (princ " " outbuf))) 184 (princ "\"\\\n" outbuf)
185 autoload)) 185 (let ((begin (save-excursion
186 (princ "\"\\\n" outbuf) 186 (set-buffer outbuf)
187 (let ((begin (save-excursion 187 (point))))
188 (set-buffer outbuf)
189 (point))))
190 (princ (substring 188 (princ (substring
191 (prin1-to-string (car elt)) 1) 189 (prin1-to-string (car elt)) 1)
192 outbuf) 190 outbuf)
@@ -206,19 +204,13 @@ are used."
206 (prin1-to-string (cdr elt)) 204 (prin1-to-string (cdr elt))
207 1) 205 1)
208 outbuf)) 206 outbuf))
209 (terpri outbuf)) 207 (terpri outbuf)))
208 (let ((print-escape-newlines t))
210 (print autoload outbuf))) 209 (print autoload outbuf)))
211 ;; Copy the rest of the line to the output. 210 ;; Copy the rest of the line to the output.
212 (let ((begin (point))) 211 (let ((begin (point)))
213 (forward-line 1) 212 (forward-line 1)
214 (princ (buffer-substring begin (point)) outbuf))) 213 (princ (buffer-substring begin (point)) outbuf)))))
215 (save-excursion
216 (set-buffer outbuf)
217 ;; Replace literal ^Ls with \f in what we just wrote.
218 (save-excursion
219 (while (search-backward "\f" begin t)
220 (delete-char 1)
221 (insert "\\f"))))))
222 ((looking-at ";") 214 ((looking-at ";")
223 ;; Don't read the comment. 215 ;; Don't read the comment.
224 (forward-line 1)) 216 (forward-line 1))