From a7a84eea2d2f38e0029e656faa6566ae11de03a3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 16 Feb 2013 11:13:40 +0200 Subject: [PATCH] Fix bug #13725 with file notifications on MS-Windows. lisp/autorevert.el (auto-revert-notify-add-watch): With 'w32notify', add watch for the file, not its parent directory, since w32notify sets up the watch for the directory internally. --- lisp/ChangeLog | 6 ++++++ lisp/autorevert.el | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 072521f1b44..19d9404c8c4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-02-16 Eli Zaretskii + + * autorevert.el (auto-revert-notify-add-watch): With 'w32notify', + add watch for the file, not its parent directory, since w32notify + sets up the watch for the directory internally. (Bug#13725) + 2013-02-16 Glenn Morris * image.el (image-default-frame-delay): New variable. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index fe6cf216363..a2d70c37762 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -519,12 +519,13 @@ will use an up-to-date value of `auto-revert-interval'" (let ((func (if (fboundp 'inotify-add-watch) 'inotify-add-watch 'w32notify-add-watch)) (aspect (if (fboundp 'inotify-add-watch) - '(create modify moved-to) '(size last-write-time)))) + '(create modify moved-to) '(size last-write-time))) + (file (if (fboundp 'inotify-add-watch) + (directory-file-name (expand-file-name default-directory)) + (buffer-file-name)))) (setq auto-revert-notify-watch-descriptor (ignore-errors - (funcall - func (directory-file-name (expand-file-name default-directory)) - aspect 'auto-revert-notify-handler))) + (funcall func file aspect 'auto-revert-notify-handler))) (if auto-revert-notify-watch-descriptor (progn (puthash -- 2.39.5