summaryrefslogtreecommitdiff
path: root/lisp/autorevert.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-01-12 13:25:39 +0200
committerEli Zaretskii <eliz@gnu.org>2013-01-12 13:25:39 +0200
commit86fbb162a47cd754b03ab01bd3142f35a34ea0fb (patch)
tree6de633d995044a481abee384ac74ad4b9161967e /lisp/autorevert.el
parentd122dcbf33ca7db8696c8cdccaea15b3200d7e36 (diff)
downloademacs-86fbb162a47cd754b03ab01bd3142f35a34ea0fb.tar.gz
Fix filtering of file notification events in autorevert.el.
lisp/autorevert.el (auto-revert-notify-handler): Fix filtering of file notification by ACTION. For filtering by file name, compare only the non-directory part of the file name.
Diffstat (limited to 'lisp/autorevert.el')
-rw-r--r--lisp/autorevert.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index fae2b88b3e2..60235cdd77b 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -528,13 +528,17 @@ will use an up-to-date value of `auto-revert-interval'"
;; Check, that event is meant for us.
;; TODO: Filter events which stop watching, like `move' or `removed'.
(cl-assert descriptor)
- (when (featurep 'inotify) (cl-assert (memq 'modify descriptor)))
- (when (featurep 'w32notify) (cl-assert (eq 'modified descriptor)))
+ (when (featurep 'inotify) (cl-assert (memq 'modify action)))
+ (when (featurep 'w32notify) (cl-assert (eq 'modified action)))
(cl-assert (bufferp buffer))
(when (stringp file)
(cl-assert (string-equal
- (directory-file-name file)
- (directory-file-name (buffer-file-name buffer)))))
+ ;; w32notify returns the basename of the file
+ ;; without its leading directories; inotify
+ ;; returns its full absolute file name.
+ (file-name-nondirectory (directory-file-name file))
+ (file-name-nondirectory (directory-file-name
+ (buffer-file-name buffer))))))
;; Mark buffer modified.
(with-current-buffer buffer