emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0bdaab76557 2/2: Minor changes of last commit


From: Michael Albinus
Subject: master 0bdaab76557 2/2: Minor changes of last commit
Date: Sun, 20 Oct 2024 04:38:17 -0400 (EDT)

branch: master
commit 0bdaab7655787d717d69581e30346233e293c6f2
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Minor changes of last commit
    
    * lisp/autorevert.el (auto-revert--last-time): Init with 0 (Epoch).
    (auto-revert-notify-handler): Simplify.
---
 lisp/autorevert.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]