]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/autoload.el
Add a provide statement.
[gnu-emacs] / lisp / emacs-lisp / autoload.el
index 21843c9601d63b5a7bf0a3612a1b2fca58ac66ee..196786e91796397990546fd1b0dd83adcd5f259a 100644 (file)
@@ -86,6 +86,7 @@ or macro definition or a defcustom)."
 
      ;; For special function-like operators, use the `autoload' function.
      ((memq car '(defun define-skeleton defmacro define-derived-mode
+                   define-compilation-mode
                   define-generic-mode easy-mmode-define-minor-mode
                   easy-mmode-define-global-mode
                   define-minor-mode defun* defmacro*))
@@ -94,7 +95,8 @@ or macro definition or a defcustom)."
             (args (case car
                    ((defun defmacro defun* defmacro*) (nth 2 form))
                    ((define-skeleton) '(&optional str arg))
-                   ((define-generic-mode define-derived-mode) nil)
+                   ((define-generic-mode define-derived-mode
+                       define-compilation-mode) nil)
                    (t)))
             (body (nthcdr (get car 'doc-string-elt) form))
             (doc (if (stringp (car body)) (pop body))))
@@ -358,11 +360,14 @@ are used."
     (message "Generating autoloads for %s...done" file)))
 \f
 ;;;###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))
@@ -462,7 +467,7 @@ Autoload section for %s is up to date."
                           (or existing-buffer
                               (kill-buffer (current-buffer))))))))
              (generate-file-autoloads file))))
-      (and (interactive-p)
+      (and save-after
           (buffer-modified-p)
           (save-buffer))