aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1993-07-07 20:13:57 +0000
committerRoland McGrath1993-07-07 20:13:57 +0000
commit88e37e7b3199ef8c0402157db557028ab3fac2a4 (patch)
treee027421d704210d9b653a9b19959865e54ce397d
parent75340584376903ce3b0525c7585fa9052184e6c4 (diff)
downloademacs-88e37e7b3199ef8c0402157db557028ab3fac2a4.tar.gz
emacs-88e37e7b3199ef8c0402157db557028ab3fac2a4.zip
(update-file-autoloads): Correctly do nothing when there are no cookies.
-rw-r--r--lisp/emacs-lisp/autoload.el28
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.")
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))))
@@ -257,20 +256,27 @@ autoloads go somewhere else.")
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 "\
267Move point to where the autoload section 273Move point to where the autoload section
268for %s should be inserted. 274for %s should be inserted.
269Then do \\[exit-recursive-edit]." 275Then 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)))