X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/872faefb07a9196a583fc8cbe146ab6a2ebc9c2b..f46305c86cd247b2396e73ce8bb064f69373834d:/lisp/autorevert.el diff --git a/lisp/autorevert.el b/lisp/autorevert.el index a2d70c3776..a2ce6017b2 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -367,8 +367,9 @@ without being changed in the part that is already in the buffer." (delq (current-buffer) auto-revert-buffer-list))) (auto-revert-set-timer) (when auto-revert-mode - (auto-revert-buffers) - (setq auto-revert-tail-mode nil))) + (let (auto-revert-use-notify) + (auto-revert-buffers) + (setq auto-revert-tail-mode nil)))) ;;;###autoload @@ -422,7 +423,8 @@ Use `auto-revert-mode' for changes other than appends!" (y-or-n-p "File changed on disk, content may be missing. \ Perform a full revert? ") ;; Use this (not just revert-buffer) for point-preservation. - (auto-revert-handler)) + (let (auto-revert-use-notify) + (auto-revert-handler))) ;; else we might reappend our own end when we save (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position @@ -467,7 +469,8 @@ specifies in the mode line." :global t :group 'auto-revert :lighter global-auto-revert-mode-text (auto-revert-set-timer) (if global-auto-revert-mode - (auto-revert-buffers) + (let (auto-revert-use-notify) + (auto-revert-buffers)) (dolist (buf (buffer-list)) (with-current-buffer buf (when auto-revert-use-notify @@ -518,8 +521,9 @@ will use an up-to-date value of `auto-revert-interval'" (not auto-revert-notify-watch-descriptor)) (let ((func (if (fboundp 'inotify-add-watch) 'inotify-add-watch 'w32notify-add-watch)) + ;; `attrib' is needed for file modification time. (aspect (if (fboundp 'inotify-add-watch) - '(create modify moved-to) '(size last-write-time))) + '(attrib create modify moved-to) '(size last-write-time))) (file (if (fboundp 'inotify-add-watch) (directory-file-name (expand-file-name default-directory)) (buffer-file-name)))) @@ -573,7 +577,8 @@ will use an up-to-date value of `auto-revert-interval'" ;; TODO: Filter events which stop watching, like `move' or `removed'. (cl-assert descriptor) (when (featurep 'inotify) - (cl-assert (or (memq 'create action) + (cl-assert (or (memq 'attrib action) + (memq 'create action) (memq 'modify action) (memq 'moved-to action)))) (when (featurep 'w32notify) (cl-assert (eq 'modified action)))