changeset 57880:52307ec50b54

(update-file-autoloads): Don't use interactive-p; take new arg SAVE-AFTER.
author Richard M. Stallman <rms@gnu.org>
date Tue, 02 Nov 2004 09:20:13 +0000
parents 7b2c608f3b0b
children f57a9010e865
files lisp/emacs-lisp/autoload.el
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/autoload.el	Tue Nov 02 09:17:50 2004 +0000
+++ b/lisp/emacs-lisp/autoload.el	Tue Nov 02 09:20:13 2004 +0000
@@ -360,11 +360,14 @@
     (message "Generating autoloads for %s...done" file)))
 
 ;;;###autoload
-(defun update-file-autoloads (file)
+(defun update-file-autoloads (file &optional save-after)
   "Update the autoloads for FILE in `generated-autoload-file'
 \(which FILE might bind in its local variables).
-Return FILE if there was no autoload cookie in it."
-  (interactive "fUpdate autoloads for file: ")
+If SAVE-AFTER is non-nil (which is always, when called interactively),
+save the buffer too.
+
+Return FILE if there was no autoload cookie in it, else nil."
+  (interactive "fUpdate autoloads for file: \np")
   (let ((load-name (let ((name (file-name-nondirectory file)))
 		     (if (string-match "\\.elc?\\(\\.\\|$\\)" name)
 			 (substring name 0 (match-beginning 0))
@@ -464,7 +467,7 @@
 			   (or existing-buffer
 			       (kill-buffer (current-buffer))))))))
 	      (generate-file-autoloads file))))
-      (and (interactive-p)
+      (and save-after
 	   (buffer-modified-p)
 	   (save-buffer))