diff options
| author | Michael Albinus | 2015-11-18 13:47:25 +0000 |
|---|---|---|
| committer | Michael Albinus | 2015-11-25 15:07:11 +0100 |
| commit | 65ba5a98d47f4305f95f960efdf424684754a11d (patch) | |
| tree | 644b229abb093a6024446bf4655d1aa0b460b453 /lisp | |
| parent | 13f3508443e4f5c48d40e4dbb11eaf875a5b2042 (diff) | |
| download | emacs-65ba5a98d47f4305f95f960efdf424684754a11d.tar.gz emacs-65ba5a98d47f4305f95f960efdf424684754a11d.zip | |
Further fixes for kqueue.
* lisp/filenotify.el (file-notify-callback): Raise also event if
directory name matches.
(file-notify-add-watch): Add `create' to the flags for `kqueue'.
* src/kqueue.c (kqueue_generate_event): Use watch_object as
argument instead of ident. Remove callback argument. Adapt
callees. Check actions whether they are monitored flags.
* test/automated/file-notify-tests.el (file-notify--test-library):
New defun.
(file-notify-test00-availability, file-notify-test02-events)
(file-notify-test04-file-validity)
(file-notify-test05-dir-validity): Use it.
(file-notify-test02-events, file-notify-test04-file-validity): Add
`read-event' calls between different file actions, in order to
give the backends a chance to rais an event. Needed especially
for kqueue. In case of deleting a directory, there are two
`deleted' events.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/filenotify.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el index eb869cf66a9..5072bf414bf 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el | |||
| @@ -258,6 +258,10 @@ EVENT is the cadr of the event in `file-notify-handle-event' | |||
| 258 | ;; File matches. | 258 | ;; File matches. |
| 259 | (string-equal | 259 | (string-equal |
| 260 | (nth 0 entry) (file-name-nondirectory file)) | 260 | (nth 0 entry) (file-name-nondirectory file)) |
| 261 | ;; Directory matches. | ||
| 262 | (string-equal | ||
| 263 | (file-name-nondirectory file) | ||
| 264 | (file-name-nondirectory (car registered))) | ||
| 261 | ;; File1 matches. | 265 | ;; File1 matches. |
| 262 | (and (stringp file1) | 266 | (and (stringp file1) |
| 263 | (string-equal | 267 | (string-equal |
| @@ -364,7 +368,7 @@ FILE is the name of the file whose event is being reported." | |||
| 364 | ((eq file-notify--library 'inotify) | 368 | ((eq file-notify--library 'inotify) |
| 365 | '(create delete delete-self modify move-self move)) | 369 | '(create delete delete-self modify move-self move)) |
| 366 | ((eq file-notify--library 'kqueue) | 370 | ((eq file-notify--library 'kqueue) |
| 367 | '(delete write extend rename)) | 371 | '(create delete write extend rename)) |
| 368 | ((eq file-notify--library 'w32notify) | 372 | ((eq file-notify--library 'w32notify) |
| 369 | '(file-name directory-name size last-write-time))))) | 373 | '(file-name directory-name size last-write-time))))) |
| 370 | (when (memq 'attribute-change flags) | 374 | (when (memq 'attribute-change flags) |