diff options
author | Roland McGrath <roland@gnu.org> | 1993-07-07 20:13:57 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1993-07-07 20:13:57 +0000 |
commit | 88e37e7b3199ef8c0402157db557028ab3fac2a4 (patch) | |
tree | e027421d704210d9b653a9b19959865e54ce397d /lisp/emacs-lisp/autoload.el | |
parent | 75340584376903ce3b0525c7585fa9052184e6c4 (diff) | |
download | emacs-88e37e7b3199ef8c0402157db557028ab3fac2a4.tar.gz |
(update-file-autoloads): Correctly do nothing when there are no cookies.
Diffstat (limited to 'lisp/emacs-lisp/autoload.el')
-rw-r--r-- | lisp/emacs-lisp/autoload.el | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 3b04cd3d1d8..940bc118e46 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -235,7 +235,6 @@ autoloads go somewhere else.") (widen) (goto-char (point-min)) (while (search-forward generate-autoload-section-header nil t) - (or done (setq done 'seen)) (let ((form (condition-case () (read (current-buffer)) (end-of-file nil)))) @@ -257,20 +256,27 @@ autoloads go somewhere else.") (generate-file-autoloads file)) (setq done t)))))) (if done + ;; There was an existing section and we have updated it. () - ;; Have the user tell us where to put the section. - (save-window-excursion - (switch-to-buffer (current-buffer)) - (with-output-to-temp-buffer "*Help*" - (princ (substitute-command-keys - (format "\ + (if (save-excursion + (set-buffer (find-file-noselect file)) + (save-excursion + (search-forward generate-autoload-cookie nil t))) + ;; There are autoload cookies in FILE. + ;; 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 for %s should be inserted. Then do \\[exit-recursive-edit]." - file)))) - (recursive-edit) - (beginning-of-line)) - (generate-file-autoloads file))) + file)))) + (recursive-edit) + (beginning-of-line)) + (generate-file-autoloads file))))) (if (interactive-p) (save-buffer)) (if (and (null existing-buffer) (setq existing-buffer (get-file-buffer file))) |