(custom-face-value-create): If face name doesn't end with "face", add
[bpt/emacs.git] / lisp / autorevert.el
index 94cae66..9af8c6c 100644 (file)
@@ -1,11 +1,11 @@
 ;;; autorevert --- revert buffers when files on disk change
 
-;; Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
 
-;; Author: Anders Lindgren <andersl@csd.uu.se>
+;; Author: Anders Lindgren <andersl@andersl.com>
 ;; Keywords: convenience
-;; Created: 1 Jun 1997
-;; Date: 3 Jul 1997
+;; Created: 1997-06-01
+;; Date: 1999-11-30
 
 ;; This file is part of GNU Emacs.
 
@@ -97,6 +97,7 @@ Global Auto-Revert Mode applies to all buffers."
 Never set this variable directly, use the command `auto-revert-mode'
 instead.")
 
+;;;###autoload
 (defcustom global-auto-revert-mode nil
   "When on, buffers are automatically reverted when files on disk change.
 
@@ -220,6 +221,7 @@ This is a minor mode that affects only the current buffer.
 Use `global-auto-revert-mode' to automatically revert all buffers."
   (interactive "P")
   (make-local-variable 'auto-revert-mode)
+  (put 'auto-revert-mode 'permanent-local t)
   (setq auto-revert-mode
        (if (null arg)
            (not auto-revert-mode)
@@ -236,7 +238,8 @@ Use `global-auto-revert-mode' to automatically revert all buffers."
   (auto-revert-set-timer)
   (when auto-revert-mode
     (auto-revert-buffers)
-    (run-hooks 'auto-revert-mode-hook)))
+    (run-hooks 'auto-revert-mode-hook))
+  auto-revert-mode)
 
 
 ;;;###autoload
@@ -349,7 +352,7 @@ the timer when no buffers need to be checked."
                                auto-revert-mode))))
                (if auto-revert-verbose
                    (message "Reverting buffer `%s'." buf))
-               (revert-buffer t t)))
+               (revert-buffer t t t)))
          ;; Remove dead buffer from `auto-revert-buffer-list'.
          (setq auto-revert-buffer-list
                (delq buf auto-revert-buffer-list))))