summaryrefslogtreecommitdiff
path: root/lisp/filenotify.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2019-05-03 17:18:13 +0200
committerMichael Albinus <michael.albinus@gmx.de>2019-05-03 17:18:13 +0200
commitd0fe28cb1d33daa059990d62556a8de20a385387 (patch)
treeae2dab44a36a6497d034d4a4dc4e08411bcbd9c9 /lisp/filenotify.el
parent24a1d5a0b5c0debd8256d71242bfa6f8448bf5af (diff)
downloademacs-d0fe28cb1d33daa059990d62556a8de20a385387.tar.gz
Add tests for remote files in auto-revert-tests
* lisp/autorevert.el (auto-revert-debug): New defvar. (auto-revert-notify-handler): Write traces. * lisp/filenotify.el (file-notify-debug): New defvar. (file-notify-handle-event, file-notify-callback): Write traces. * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered): Handle nil `vc-handled-backends'. * test/lisp/autorevert-tests.el (auto-revert-test-remote-temporary-file-directory): New defconst. Handle also $REMOTE_FILE_NOTIFY_LIBRARY. (auto-revert--test-enabled-remote-checked): New defvar. (auto-revert--test-enabled-remote): New defun. (auto-revert--wait-for-revert): Rewrite without timeout. (auto-revert--deftest-remote): New defmacro. (auto-revert-test01-auto-revert-several-files): (auto-revert-test02-auto-revert-deleted-file): Adapt for remote files. (auto-revert-test02-auto-revert-deleted-file): Use `auto-revert-debug' for debug messages. (auto-revert-test00-auto-revert-mode-remote) (auto-revert-test01-auto-revert-several-files-mode-remote) (auto-revert-test02-auto-revert-deleted-file-mode-remote) (auto-revert-test03-auto-revert-tail-mode-mode-remote) (auto-revert-test04-auto-revert-mode-dired-mode-remote): New tests. * test/lisp/filenotify-tests.el (file-notify--test-event-handler): Use `file-notify-debug' for debug messages.
Diffstat (limited to 'lisp/filenotify.el')
-rw-r--r--lisp/filenotify.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 4d22061138f..a6054c175f1 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -30,6 +30,9 @@
(require 'cl-lib)
(eval-when-compile (require 'subr-x))
+(defvar file-notify-debug nil
+ "Use for debug messages.")
+
(defconst file-notify--library
(cond
((featurep 'inotify) 'inotify)
@@ -93,7 +96,8 @@ If EVENT is a filewatch event, call its callback. It has the format
Otherwise, signal a `file-notify-error'."
(interactive "e")
- ;;(message "file-notify-handle-event %S" event)
+ (when file-notify-debug
+ (message "file-notify-handle-event %S" event))
(if (and (consp event)
(eq (car event) 'file-notify)
(>= (length event) 3))
@@ -242,11 +246,12 @@ EVENT is the cadr of the event in `file-notify-handle-event'
(string-equal
(file-notify--watch-filename watch)
(file-name-nondirectory file1)))))
- ;;(message
- ;;"file-notify-callback %S %S %S %S %S %S %S"
- ;;desc action file file1 watch
- ;;(file-notify--event-watched-file event)
- ;;(file-notify--watch-directory watch))
+ (when file-notify-debug
+ (message
+ "file-notify-callback %S %S %S %S %S %S %S"
+ desc action file file1 watch
+ (file-notify--event-watched-file event)
+ (file-notify--watch-directory watch)))
(funcall (file-notify--watch-callback watch)
(if file1
`(,desc ,action ,file ,file1)