emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master d0fd980: Finish changes in autorevert from commit 5


From: Michael Albinus
Subject: [Emacs-diffs] master d0fd980: Finish changes in autorevert from commit 530bb2dc68
Date: Mon, 22 Jan 2018 03:12:25 -0500 (EST)

branch: master
commit d0fd9809d7574c67a181225fcc1c59afdbb1295c
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Finish changes in autorevert from commit 530bb2dc68
    
    * lisp/autorevert.el (auto-revert-buffers):
    Check `auto-revert-timer' being a timerp.
    
    * test/lisp/filenotify-tests.el (file-notify-test04-autorevert):
    Adapt test in order to cover changed behavior of autorevert.
---
 lisp/autorevert.el            | 3 ++-
 test/lisp/filenotify-tests.el | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index da89426..cf145e0 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -803,7 +803,8 @@ the timer when no buffers need to be checked."
       ;; Check if we should cancel the timer.
       (when (and (not global-auto-revert-mode)
                 (null auto-revert-buffer-list))
-       (cancel-timer auto-revert-timer)
+        (if (timerp auto-revert-timer)
+           (cancel-timer auto-revert-timer))
        (setq auto-revert-timer nil)))))
 
 
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index 8745fdc..f2feef6 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -884,8 +884,8 @@ delivered."
             ;; Stop file notification.  Autorevert shall still work via 
polling.
            (file-notify-rm-watch auto-revert-notify-watch-descriptor)
            (file-notify--wait-for-events
-            timeout (null auto-revert-use-notify))
-           (should-not auto-revert-use-notify)
+            timeout (null auto-revert-notify-watch-descriptor))
+           (should auto-revert-use-notify)
            (should-not auto-revert-notify-watch-descriptor)
 
            ;; Modify file.  We wait for two seconds, in order to
@@ -902,7 +902,10 @@ delivered."
                (string-match
                 (format-message "Reverting buffer `%s'." (buffer-name buf))
                 captured-messages))
-              (should (string-match "foo bla" (buffer-string)))))
+              (should (string-match "foo bla" (buffer-string))))
+
+            ;; Stop autorevert, in order to cleanup descriptor.
+            (auto-revert-mode -1))
 
           ;; The environment shall be cleaned up.
           (file-notify--test-cleanup-p))



reply via email to

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