summaryrefslogtreecommitdiff
path: root/lisp/filenotify.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-05-18 19:48:32 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2019-05-18 20:48:01 +0200
commit3dcacb09a921593509d0975e4f6a9434a54521ae (patch)
tree54226997d8df21560c0bd2240b515dcef68c3e8c /lisp/filenotify.el
parent028a23dc9d138907d7f434e73febf6ec08b28e16 (diff)
downloademacs-3dcacb09a921593509d0975e4f6a9434a54521ae.tar.gz
Fix broken logic in file-notify
* lisp/filenotify.el (file-notify-callback): Repair warped condition that didn't match rename-to/from events correctly.
Diffstat (limited to 'lisp/filenotify.el')
-rw-r--r--lisp/filenotify.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index a6054c175f1..26b83ce66c0 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -161,12 +161,14 @@ EVENT is the cadr of the event in `file-notify-handle-event'
(while actions
(let ((action (pop actions)))
;; Send pending event, if it doesn't match.
+ ;; We only handle {renamed,moved}-{from,to} pairs when these
+ ;; arrive in order without anything else in-between.
(when (and file-notify--pending-event
- ;; The cookie doesn't match.
- (not (equal (file-notify--event-cookie
- (car file-notify--pending-event))
- (file-notify--event-cookie event)))
(or
+ ;; The cookie doesn't match.
+ (not (equal (file-notify--event-cookie
+ (car file-notify--pending-event))
+ (file-notify--event-cookie event)))
;; inotify.
(and (eq (nth 1 (car file-notify--pending-event))
'moved-from)