comparison lisp/emacs-lisp/autoload.el @ 4026:7b72e141f1ad

(update-file-autoloads): Correctly do nothing when there are no cookies.
author Roland McGrath <roland@gnu.org>
date Wed, 07 Jul 1993 20:13:57 +0000
parents 26e0209b6e56
children 5126824061ef
comparison
equal deleted inserted replaced
4025:92cd14c9ea80 4026:7b72e141f1ad
233 (save-excursion 233 (save-excursion
234 (save-restriction 234 (save-restriction
235 (widen) 235 (widen)
236 (goto-char (point-min)) 236 (goto-char (point-min))
237 (while (search-forward generate-autoload-section-header nil t) 237 (while (search-forward generate-autoload-section-header nil t)
238 (or done (setq done 'seen))
239 (let ((form (condition-case () 238 (let ((form (condition-case ()
240 (read (current-buffer)) 239 (read (current-buffer))
241 (end-of-file nil)))) 240 (end-of-file nil))))
242 (if (string= (nth 2 form) load-name) 241 (if (string= (nth 2 form) load-name)
243 (let ((begin (match-beginning 0)) 242 (let ((begin (match-beginning 0))
255 (search-forward generate-autoload-section-trailer) 254 (search-forward generate-autoload-section-trailer)
256 (delete-region begin (point)) 255 (delete-region begin (point))
257 (generate-file-autoloads file)) 256 (generate-file-autoloads file))
258 (setq done t)))))) 257 (setq done t))))))
259 (if done 258 (if done
259 ;; There was an existing section and we have updated it.
260 () 260 ()
261 ;; Have the user tell us where to put the section. 261 (if (save-excursion
262 (save-window-excursion 262 (set-buffer (find-file-noselect file))
263 (switch-to-buffer (current-buffer)) 263 (save-excursion
264 (with-output-to-temp-buffer "*Help*" 264 (search-forward generate-autoload-cookie nil t)))
265 (princ (substitute-command-keys 265 ;; There are autoload cookies in FILE.
266 (format "\ 266 ;; Have the user tell us where to put the new section.
267 (progn
268 (save-window-excursion
269 (switch-to-buffer (current-buffer))
270 (with-output-to-temp-buffer "*Help*"
271 (princ (substitute-command-keys
272 (format "\
267 Move point to where the autoload section 273 Move point to where the autoload section
268 for %s should be inserted. 274 for %s should be inserted.
269 Then do \\[exit-recursive-edit]." 275 Then do \\[exit-recursive-edit]."
270 file)))) 276 file))))
271 (recursive-edit) 277 (recursive-edit)
272 (beginning-of-line)) 278 (beginning-of-line))
273 (generate-file-autoloads file))) 279 (generate-file-autoloads file)))))
274 (if (interactive-p) (save-buffer)) 280 (if (interactive-p) (save-buffer))
275 (if (and (null existing-buffer) 281 (if (and (null existing-buffer)
276 (setq existing-buffer (get-file-buffer file))) 282 (setq existing-buffer (get-file-buffer file)))
277 (kill-buffer existing-buffer))))) 283 (kill-buffer existing-buffer)))))
278 284