]> code.delx.au - gnu-emacs/blobdiff - lisp/autorevert.el
Merge from emacs-24; up to 2012-12-17T11:17:34Z!rgm@gnu.org
[gnu-emacs] / lisp / autorevert.el
index 25a953e17199f48556d247a6a88b139e3546a80a..fe6cf216363218c8678b8f8b5b050c0da493cacc 100644 (file)
@@ -278,7 +278,7 @@ This variable becomes buffer local when set in any fashion.")
   "If non-nil Auto Revert Mode uses file notification functions.
 This requires Emacs being compiled with file notification
 support (see `auto-revert-notify-enabled').  You should set this
-variable through Custom only."
+variable through Custom."
   :group 'auto-revert
   :type 'boolean
   :set (lambda (variable value)
@@ -289,6 +289,7 @@ variable through Custom only."
               (with-current-buffer buf
                 (when (symbol-value 'auto-revert-notify-watch-descriptor)
                   (auto-revert-notify-rm-watch)))))))
+  :initialize 'custom-initialize-default
   :version "24.4")
 
 (defcustom auto-revert-notify-exclude-dir-regexp
@@ -612,21 +613,16 @@ This is an internal function used by Auto-Revert Mode."
            (or (and buffer-file-name
                     (or auto-revert-remote-files
                         (not (file-remote-p buffer-file-name)))
+                    (or (not auto-revert-use-notify)
+                        auto-revert-notify-modified-p)
                     (if auto-revert-tail-mode
-                        (and (or (not auto-revert-use-notify)
-                                 auto-revert-notify-modified-p)
-                             (file-readable-p buffer-file-name)
+                        (and (file-readable-p buffer-file-name)
                              (/= auto-revert-tail-pos
                                  (setq size
                                        (nth 7 (file-attributes
                                                buffer-file-name)))))
-                      ;; When `auto-revert-use-notify' is set, we do
-                      ;; not apply further checks for performance
-                      ;; reasons.
-                      (if auto-revert-use-notify
-                          auto-revert-notify-modified-p
-                        (and (file-readable-p buffer-file-name)
-                             (not (verify-visited-file-modtime buffer))))))
+                      (and (file-readable-p buffer-file-name)
+                           (not (verify-visited-file-modtime buffer)))))
                (and (or auto-revert-mode
                         global-auto-revert-non-file-buffers)
                     revert-buffer-function
@@ -634,8 +630,8 @@ This is an internal function used by Auto-Revert Mode."
                     (functionp buffer-stale-function)
                     (funcall buffer-stale-function t))))
           eob eoblist)
+      (setq auto-revert-notify-modified-p nil)
       (when revert
-       (setq auto-revert-notify-modified-p nil)
        (when (and auto-revert-verbose
                   (not (eq revert 'fast)))
          (message "Reverting buffer `%s'." (buffer-name)))