]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor changes of last commit
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 20 Oct 2024 08:38:00 +0000 (10:38 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 22 Oct 2024 19:01:06 +0000 (21:01 +0200)
* lisp/autorevert.el (auto-revert--last-time): Init with 0 (Epoch).
(auto-revert-notify-handler): Simplify.

(cherry picked from commit 0bdaab7655787d717d69581e30346233e293c6f2)

lisp/autorevert.el

index ef758584c0d9a760a9df3289b63ba00222779f4d..94082df45026443c705a6fb18ee827c8476b4fc3 100644 (file)
@@ -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)