diff options
| author | Mattias EngdegÄrd | 2019-05-18 19:48:32 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-05-18 20:48:01 +0200 |
| commit | 3dcacb09a921593509d0975e4f6a9434a54521ae (patch) | |
| tree | 54226997d8df21560c0bd2240b515dcef68c3e8c | |
| parent | 028a23dc9d138907d7f434e73febf6ec08b28e16 (diff) | |
| download | emacs-3dcacb09a921593509d0975e4f6a9434a54521ae.tar.gz emacs-3dcacb09a921593509d0975e4f6a9434a54521ae.zip | |
Fix broken logic in file-notify
* lisp/filenotify.el (file-notify-callback):
Repair warped condition that didn't match rename-to/from events correctly.
| -rw-r--r-- | lisp/filenotify.el | 10 |
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' | |||
| 161 | (while actions | 161 | (while actions |
| 162 | (let ((action (pop actions))) | 162 | (let ((action (pop actions))) |
| 163 | ;; Send pending event, if it doesn't match. | 163 | ;; Send pending event, if it doesn't match. |
| 164 | ;; We only handle {renamed,moved}-{from,to} pairs when these | ||
| 165 | ;; arrive in order without anything else in-between. | ||
| 164 | (when (and file-notify--pending-event | 166 | (when (and file-notify--pending-event |
| 165 | ;; The cookie doesn't match. | ||
| 166 | (not (equal (file-notify--event-cookie | ||
| 167 | (car file-notify--pending-event)) | ||
| 168 | (file-notify--event-cookie event))) | ||
| 169 | (or | 167 | (or |
| 168 | ;; The cookie doesn't match. | ||
| 169 | (not (equal (file-notify--event-cookie | ||
| 170 | (car file-notify--pending-event)) | ||
| 171 | (file-notify--event-cookie event))) | ||
| 170 | ;; inotify. | 172 | ;; inotify. |
| 171 | (and (eq (nth 1 (car file-notify--pending-event)) | 173 | (and (eq (nth 1 (car file-notify--pending-event)) |
| 172 | 'moved-from) | 174 | 'moved-from) |