]> git.eshelyaron.com Git - emacs.git/commitdiff
Precise handling of filenotify `stopped' events
authorMattias Engdegård <mattiase@acm.org>
Sat, 20 Apr 2019 11:16:37 +0000 (13:16 +0200)
committerMattias Engdegård <mattiase@acm.org>
Mon, 22 Apr 2019 16:22:20 +0000 (18:22 +0200)
* 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

index 6f2415a3ae45ffb27755162ea767d4215f37e20e..2d148d609514061ea8e6251705f3b799760d6605 100644 (file)
@@ -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.