]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix broken logic in file-notify
authorMattias Engdegård <mattiase@acm.org>
Sat, 18 May 2019 17:48:32 +0000 (19:48 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sat, 18 May 2019 18:48:01 +0000 (20:48 +0200)
* lisp/filenotify.el (file-notify-callback):
Repair warped condition that didn't match rename-to/from events correctly.

lisp/filenotify.el

index a6054c175f167d23e4fe9f831b1b8f9141bf3592..26b83ce66c082e9179a2b2d31618afaeb4fcdf8f 100644 (file)
@@ -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)