diff options
| author | Mattias EngdegÄrd | 2019-04-20 13:16:37 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-04-22 18:22:20 +0200 |
| commit | 11e75b031baad4305b2a6fd52dc43d11d65c7dc5 (patch) | |
| tree | 3a0bddf1634457b385895019ebc82c338dd057ec | |
| parent | f20c1ffd05aab43a14ade3c433216a6c6fbe4b24 (diff) | |
| download | emacs-11e75b031baad4305b2a6fd52dc43d11d65c7dc5.tar.gz emacs-11e75b031baad4305b2a6fd52dc43d11d65c7dc5.zip | |
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.
| -rw-r--r-- | lisp/autorevert.el | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 6f2415a3ae4..2d148d60951 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -594,19 +594,16 @@ no more reverts are possible until the next call of | |||
| 594 | 594 | ||
| 595 | (if (eq action 'stopped) | 595 | (if (eq action 'stopped) |
| 596 | ;; File notification has stopped. Continue with polling. | 596 | ;; File notification has stopped. Continue with polling. |
| 597 | (cl-dolist (buffer | 597 | (cl-dolist (buffer buffers) |
| 598 | (if global-auto-revert-mode | ||
| 599 | (buffer-list) auto-revert-buffer-list)) | ||
| 600 | (with-current-buffer buffer | 598 | (with-current-buffer buffer |
| 601 | (when (and (equal descriptor auto-revert-notify-watch-descriptor) | 599 | (when (or |
| 602 | (or | 600 | ;; A buffer associated with a file. |
| 603 | ;; A buffer associated with a file. | 601 | (and (stringp buffer-file-name) |
| 604 | (and (stringp buffer-file-name) | 602 | (string-equal |
| 605 | (string-equal | 603 | (file-name-nondirectory file) |
| 606 | (file-name-nondirectory file) | 604 | (file-name-nondirectory buffer-file-name))) |
| 607 | (file-name-nondirectory buffer-file-name))) | 605 | ;; A buffer w/o a file, like dired. |
| 608 | ;; A buffer w/o a file, like dired. | 606 | (null buffer-file-name)) |
| 609 | (null buffer-file-name))) | ||
| 610 | (auto-revert-notify-rm-watch)))) | 607 | (auto-revert-notify-rm-watch)))) |
| 611 | 608 | ||
| 612 | ;; Loop over all buffers, in order to find the intended one. | 609 | ;; Loop over all buffers, in order to find the intended one. |