1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

(update-file-autoloads): Correctly do nothing when there are no cookies.

This commit is contained in:
Roland McGrath 1993-07-07 20:13:57 +00:00
parent 7534058437
commit 88e37e7b31

View file

@ -235,7 +235,6 @@ autoloads go somewhere else.")
(widen) (widen)
(goto-char (point-min)) (goto-char (point-min))
(while (search-forward generate-autoload-section-header nil t) (while (search-forward generate-autoload-section-header nil t)
(or done (setq done 'seen))
(let ((form (condition-case () (let ((form (condition-case ()
(read (current-buffer)) (read (current-buffer))
(end-of-file nil)))) (end-of-file nil))))
@ -257,20 +256,27 @@ autoloads go somewhere else.")
(generate-file-autoloads file)) (generate-file-autoloads file))
(setq done t)))))) (setq done t))))))
(if done (if done
;; There was an existing section and we have updated it.
() ()
;; Have the user tell us where to put the section. (if (save-excursion
(save-window-excursion (set-buffer (find-file-noselect file))
(switch-to-buffer (current-buffer)) (save-excursion
(with-output-to-temp-buffer "*Help*" (search-forward generate-autoload-cookie nil t)))
(princ (substitute-command-keys ;; There are autoload cookies in FILE.
(format "\ ;; Have the user tell us where to put the new section.
(progn
(save-window-excursion
(switch-to-buffer (current-buffer))
(with-output-to-temp-buffer "*Help*"
(princ (substitute-command-keys
(format "\
Move point to where the autoload section Move point to where the autoload section
for %s should be inserted. for %s should be inserted.
Then do \\[exit-recursive-edit]." Then do \\[exit-recursive-edit]."
file)))) file))))
(recursive-edit) (recursive-edit)
(beginning-of-line)) (beginning-of-line))
(generate-file-autoloads file))) (generate-file-autoloads file)))))
(if (interactive-p) (save-buffer)) (if (interactive-p) (save-buffer))
(if (and (null existing-buffer) (if (and (null existing-buffer)
(setq existing-buffer (get-file-buffer file))) (setq existing-buffer (get-file-buffer file)))