emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 11e75b0: Precise handling of filenotify `stopped' e


From: Mattias Engdegård
Subject: [Emacs-diffs] master 11e75b0: Precise handling of filenotify `stopped' events
Date: Mon, 22 Apr 2019 12:46:36 -0400 (EDT)

branch: master
commit 11e75b031baad4305b2a6fd52dc43d11d65c7dc5
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Precise handling of filenotify `stopped' events
    
    * lisp/autorevert.el (auto-revert-notify-handler):
    When getting a `stopped' event, deal with it for the buffers it applies to,
    rather than for all buffers in auto-revert mode.
---
 lisp/autorevert.el | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 6f2415a..2d148d6 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -594,19 +594,16 @@ no more reverts are possible until the next call of
 
       (if (eq action 'stopped)
           ;; File notification has stopped.  Continue with polling.
-          (cl-dolist (buffer
-                      (if global-auto-revert-mode
-                          (buffer-list) auto-revert-buffer-list))
+          (cl-dolist (buffer buffers)
             (with-current-buffer buffer
-              (when (and (equal descriptor auto-revert-notify-watch-descriptor)
-                         (or
-                          ;; A buffer associated with a file.
-                          (and (stringp buffer-file-name)
-                               (string-equal
-                                (file-name-nondirectory file)
-                                (file-name-nondirectory buffer-file-name)))
-                          ;; A buffer w/o a file, like dired.
-                          (null buffer-file-name)))
+              (when (or
+                     ;; A buffer associated with a file.
+                     (and (stringp buffer-file-name)
+                          (string-equal
+                           (file-name-nondirectory file)
+                           (file-name-nondirectory buffer-file-name)))
+                     ;; A buffer w/o a file, like dired.
+                     (null buffer-file-name))
                 (auto-revert-notify-rm-watch))))
 
         ;; Loop over all buffers, in order to find the intended one.



reply via email to

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