From: Michael Albinus Date: Sun, 20 Oct 2024 08:38:00 +0000 (+0200) Subject: Minor changes of last commit X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=15c64fdb52572089acbb7527aabf25c42920a8ac;p=emacs.git Minor changes of last commit * lisp/autorevert.el (auto-revert--last-time): Init with 0 (Epoch). (auto-revert-notify-handler): Simplify. (cherry picked from commit 0bdaab7655787d717d69581e30346233e293c6f2) --- diff --git a/lisp/autorevert.el b/lisp/autorevert.el index ef758584c0d..94082df4502 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -370,7 +370,7 @@ buffer.") "Non-nil when file has been modified on the file system. This has been reported by a file notification event.") -(defvar-local auto-revert--last-time nil +(defvar-local auto-revert--last-time 0 ;; Epoch. "The last time of buffer was reverted.") (defvar auto-revert-debug nil @@ -752,16 +752,15 @@ system.") ;; Mark buffer modified. (setq auto-revert-notify-modified-p t) - ;; Lock out the buffer + ;; Lock out the buffer. (unless auto-revert--lockout-timer (setq auto-revert--lockout-timer (run-with-timer auto-revert--lockout-interval nil #'auto-revert--end-lockout buffer)) - ;; Revert it when first entry or it was reverted intervals ago - (when (or (null auto-revert--last-time) - (> (float-time (time-since auto-revert--last-time)) - auto-revert--lockout-interval)) + ;; Revert it when first entry or it was reverted intervals ago. + (when (> (float-time (time-since auto-revert--last-time)) + auto-revert--lockout-interval) (auto-revert-handler)))))))))) (defun auto-revert--end-lockout (buffer)