diff options
| author | Eli Zaretskii | 2013-01-12 13:25:39 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-01-12 13:25:39 +0200 |
| commit | 86fbb162a47cd754b03ab01bd3142f35a34ea0fb (patch) | |
| tree | 6de633d995044a481abee384ac74ad4b9161967e | |
| parent | d122dcbf33ca7db8696c8cdccaea15b3200d7e36 (diff) | |
| download | emacs-86fbb162a47cd754b03ab01bd3142f35a34ea0fb.tar.gz emacs-86fbb162a47cd754b03ab01bd3142f35a34ea0fb.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/autorevert.el | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 665620ff375..c0290c57a50 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-01-12 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * autorevert.el (auto-revert-notify-handler): Fix filtering of | ||
| 4 | file notification by ACTION. For filtering by file name, compare | ||
| 5 | only the non-directory part of the file name. | ||
| 6 | |||
| 1 | 2013-01-12 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2013-01-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * autorevert.el: Use cl-lib instead of cl. | 9 | * autorevert.el: Use cl-lib instead of cl. |
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'" | |||
| 528 | ;; Check, that event is meant for us. | 528 | ;; Check, that event is meant for us. |
| 529 | ;; TODO: Filter events which stop watching, like `move' or `removed'. | 529 | ;; TODO: Filter events which stop watching, like `move' or `removed'. |
| 530 | (cl-assert descriptor) | 530 | (cl-assert descriptor) |
| 531 | (when (featurep 'inotify) (cl-assert (memq 'modify descriptor))) | 531 | (when (featurep 'inotify) (cl-assert (memq 'modify action))) |
| 532 | (when (featurep 'w32notify) (cl-assert (eq 'modified descriptor))) | 532 | (when (featurep 'w32notify) (cl-assert (eq 'modified action))) |
| 533 | (cl-assert (bufferp buffer)) | 533 | (cl-assert (bufferp buffer)) |
| 534 | (when (stringp file) | 534 | (when (stringp file) |
| 535 | (cl-assert (string-equal | 535 | (cl-assert (string-equal |
| 536 | (directory-file-name file) | 536 | ;; w32notify returns the basename of the file |
| 537 | (directory-file-name (buffer-file-name buffer))))) | 537 | ;; without its leading directories; inotify |
| 538 | ;; returns its full absolute file name. | ||
| 539 | (file-name-nondirectory (directory-file-name file)) | ||
| 540 | (file-name-nondirectory (directory-file-name | ||
| 541 | (buffer-file-name buffer)))))) | ||
| 538 | 542 | ||
| 539 | ;; Mark buffer modified. | 543 | ;; Mark buffer modified. |
| 540 | (with-current-buffer buffer | 544 | (with-current-buffer buffer |