From d5a10aefee22cf1d092edad26c845e049ab8861c Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 7 Feb 2016 19:30:01 +0100 Subject: Fix Bug#22557 * lisp/filenotify.el (file-notify-callback): Do not send a `stopped' event in case of backup by renaming. (Bug#22557) * test/automated/Makefile.in: Use $(SELECTOR_EXPENSIVE) for all targets but check and check-maybe. * test/automated/file-notify-tests.el (file-notify--test-read-event-timeout): New defconst. (file-notify--deftest-remote, file-notify--wait-for-events) (file-notify-test02-events) (file-notify-test04-file-validity) (file-notify-test06-many-events): Use it. (file-notify--test-cleanup): Make it more robust. Delete also backup file. (file-notify-test07-backup): New test. --- lisp/filenotify.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lisp') diff --git a/lisp/filenotify.el b/lisp/filenotify.el index faa801ee6e7..66e7fd7a315 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -242,10 +242,14 @@ EVENT is the cadr of the event in `file-notify-handle-event' (and (memq action '(deleted renamed)) (= (length (cdr registered)) 1) + ;; Not, when a file is backed up. + (not (and (stringp file1) (backup-file-name-p file1))) (or + ;; Watched file or directory is concerned. (string-equal (file-name-nondirectory file) (file-name-nondirectory (car registered))) + ;; File inside a watched directory is concerned. (string-equal (file-name-nondirectory file) (car (cadr registered))))))) -- cgit v1.2.1