1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-02 08:22:22 +00:00

Fix broken logic in file-notify

* lisp/filenotify.el (file-notify-callback):
Repair warped condition that didn't match rename-to/from events correctly.
This commit is contained in:
Mattias Engdegård 2019-05-18 19:48:32 +02:00
parent 028a23dc9d
commit 3dcacb09a9

View 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)