]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #13725 with file notifications on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Feb 2013 09:13:40 +0000 (11:13 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Feb 2013 09:13:40 +0000 (11:13 +0200)
 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
lisp/autorevert.el

index 072521f1b4480c2dd84edb751680f2b4ad1696c8..19d9404c8c43209f31d0ebc965dd4097556fd24e 100644 (file)
@@ -1,3 +1,9 @@
+2013-02-16  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <rgm@gnu.org>
 
        * image.el (image-default-frame-delay): New variable.
index fe6cf216363218c8678b8f8b5b050c0da493cacc..a2d70c37762b48a3d25de3a2f865f0856adf1bf3 100644 (file)
@@ -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