aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2015-11-20 18:06:42 +0000
committerMichael Albinus2015-11-25 15:07:12 +0100
commit0247489fed0f70b2abf960de48bc4432381a581b (patch)
tree28e4de085d082377dfee71b800fff0b644cea3e1 /lisp
parent5154781141c2305c24103beb358453d30a838921 (diff)
downloademacs-0247489fed0f70b2abf960de48bc4432381a581b.tar.gz
emacs-0247489fed0f70b2abf960de48bc4432381a581b.zip
Rework file notifications, kqueue has problems with directory monitors
* lisp/filenotify.el (file-notify-add-watch): Call the native add-watch function on the file, not on the dir. * src/kqueue.c (kqueue_compare_dir_list): Make also bookkeeping about already deleted entries. * test/automated/auto-revert-tests.el (auto-revert-test01-auto-revert-several-files): Do not call "cp -f" since this deletes the target file first. * test/automated/file-notify-tests.el (file-notify--test-event-test): Make stronger checks. (file-notify-test01-add-watch, file-notify-test02-events) (file-notify-test04-file-validity, file-notify-test05-dir-validity): Rewrite in order to call file monitors but directory monitors. (file-notify-test06-many-events): Ler rename work in both directions.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/filenotify.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 5072bf414bf..0d7a2b914c6 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -236,7 +236,7 @@ EVENT is the cadr of the event in `file-notify-handle-event'
236 (setq pending-event nil)) 236 (setq pending-event nil))
237 237
238 ;; Check for stopped. 238 ;; Check for stopped.
239 ;;(message "file-notify-callback %S %S" file registered) 239 ;;(message "file-notify-callback %S %S %S" file file1 registered)
240 (setq 240 (setq
241 stopped 241 stopped
242 (or 242 (or
@@ -342,7 +342,7 @@ FILE is the name of the file whose event is being reported."
342 ;; A file name handler could exist even if there is no local 342 ;; A file name handler could exist even if there is no local
343 ;; file notification support. 343 ;; file notification support.
344 (setq desc (funcall 344 (setq desc (funcall
345 handler 'file-notify-add-watch dir flags callback)) 345 handler 'file-notify-add-watch file flags callback))
346 346
347 ;; Check, whether Emacs has been compiled with file notification 347 ;; Check, whether Emacs has been compiled with file notification
348 ;; support. 348 ;; support.
@@ -379,7 +379,7 @@ FILE is the name of the file whose event is being reported."
379 l-flags))) 379 l-flags)))
380 380
381 ;; Call low-level function. 381 ;; Call low-level function.
382 (setq desc (funcall func dir l-flags 'file-notify-callback))) 382 (setq desc (funcall func file l-flags 'file-notify-callback)))
383 383
384 ;; Modify `file-notify-descriptors'. 384 ;; Modify `file-notify-descriptors'.
385 (setq file (unless (file-directory-p file) (file-name-nondirectory file)) 385 (setq file (unless (file-directory-p file) (file-name-nondirectory file))