Commit d5a10aef authored by Michael Albinus's avatar Michael Albinus

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.
parent 67fcd5ad
......@@ -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)))))))
......
......@@ -89,10 +89,14 @@ WRITE_LOG = > $@ 2>&1 || { stat=ERROR; cat $@; }; echo $$stat: $@
## Beware: it approximates 'no-byte-compile', so watch out for false-positives!
SELECTOR_DEFAULT = (quote (not (tag :expensive-test)))
SELECTOR_EXPENSIVE = nil
ifndef SELECTOR
ifdef SELECTOR
SELECTOR_ACTUAL=$(SELECTOR)
else ifeq ($(MAKECMDGOALS),check)
SELECTOR_ACTUAL=$(SELECTOR_DEFAULT)
else ifeq ($(MAKECMDGOALS),check-maybe)
SELECTOR_ACTUAL=$(SELECTOR_DEFAULT)
else
SELECTOR_ACTUAL=$(SELECTOR)
SELECTOR_ACTUAL=$(SELECTOR_EXPENSIVE)
endif
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment