From: Michael Albinus Date: Tue, 4 Feb 2025 13:32:46 +0000 (+0100) Subject: Fix some checks in autorevert.el X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8257b24d6c998c66ee394ac23abd72f17201d6e8;p=emacs.git Fix some checks in autorevert.el * lisp/autorevert.el (auto-revert-handler): Rework checks. (auto-revert-handler): Don't run `vc-refresh-state' in `auto-revert-tail-mode'. (cherry picked from commit 2b1c25e62b3ff1718cfebda9d0e6b670c903b4cd) --- diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 2ae71c07226..6392350100b 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -818,23 +818,22 @@ This is an internal function used by Auto-Revert Mode." (not (file-remote-p buffer-file-name))) (or (not auto-revert-notify-watch-descriptor) auto-revert-notify-modified-p) + (not (memq (current-buffer) inhibit-auto-revert-buffers)) (if auto-revert-tail-mode (and (file-readable-p buffer-file-name) (/= auto-revert-tail-pos (setq size (file-attribute-size (file-attributes buffer-file-name))))) - (and (not (memq (current-buffer) - inhibit-auto-revert-buffers)) - (funcall (or buffer-stale-function - #'buffer-stale--default-function) - t)))) + (funcall (or buffer-stale-function + #'buffer-stale--default-function) + t))) (and (or auto-revert-mode global-auto-revert-non-file-buffers) - (and (not (memq (current-buffer) inhibit-auto-revert-buffers)) - (funcall (or buffer-stale-function - #'buffer-stale--default-function) - t))))) + (not (memq (current-buffer) inhibit-auto-revert-buffers)) + (funcall (or buffer-stale-function + #'buffer-stale--default-function) + t)))) eob eoblist) (setq auto-revert-notify-modified-p nil auto-revert--last-time (current-time)) @@ -869,7 +868,7 @@ This is an internal function used by Auto-Revert Mode." (set-window-point window (point-max))))) ;; `preserve-modes' avoids changing the (minor) modes. But we do ;; want to reset the mode for VC, so we do it manually. - (when (or revert auto-revert-check-vc-info) + (when (and (not auto-revert-tail-mode) (or revert auto-revert-check-vc-info)) (let ((revert-buffer-in-progress-p t)) (vc-refresh-state)))))