Mercurial > emacs
comparison lisp/emacs-lisp/autoload.el @ 5854:9d1ae808403b
(generate-file-autoloads): Don't frob literal formfeeds into \f; just bind
print-escape-newlines to t around printing (now has same effect).
author | Roland McGrath <roland@gnu.org> |
---|---|
date | Tue, 08 Feb 1994 23:03:09 +0000 |
parents | d01185037467 |
children | f18b10850c00 |
comparison
equal
deleted
inserted
replaced
5853:4934e5381fb2 | 5854:9d1ae808403b |
---|---|
153 (cond | 153 (cond |
154 ((looking-at (regexp-quote generate-autoload-cookie)) | 154 ((looking-at (regexp-quote generate-autoload-cookie)) |
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) |
193 ;; Insert a backslash before each ( that | 191 ;; Insert a backslash before each ( that |
194 ;; appears at the beginning of a line in | 192 ;; appears at the beginning of a line in |
204 (princ " " outbuf) | 202 (princ " " outbuf) |
205 (princ (substring | 203 (princ (substring |
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)) |
225 (t | 217 (t |
226 (forward-sexp 1) | 218 (forward-sexp 1) |