emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111499: Fix filtering of file notifi


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111499: Fix filtering of file notification events in autorevert.el.
Date: Sat, 12 Jan 2013 13:25:39 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111499
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2013-01-12 13:25:39 +0200
message:
  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.
modified:
  lisp/ChangeLog
  lisp/autorevert.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-01-12 04:17:08 +0000
+++ b/lisp/ChangeLog    2013-01-12 11:25:39 +0000
@@ -1,3 +1,9 @@
+2013-01-12  Eli Zaretskii  <address@hidden>
+
+       * 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.
+
 2013-01-12  Stefan Monnier  <address@hidden>
 
        * autorevert.el: Use cl-lib instead of cl.

=== modified file 'lisp/autorevert.el'
--- a/lisp/autorevert.el        2013-01-12 04:17:08 +0000
+++ b/lisp/autorevert.el        2013-01-12 11:25:39 +0000
@@ -528,13 +528,17 @@
        ;; 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]