From 4ad0fc0dd08d65978ed8a1637bc1a14c26b41bee Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 15 Oct 2021 16:29:11 +0200 Subject: [PATCH] Precise documentation of file-notify-add-watch * doc/lispref/os.texi (File Notifications): * lisp/filenotify.el (file-notify-add-watch): Precise, that watching a directory includes reports on file changes for some backends. (Bug#51146) --- doc/lispref/os.texi | 5 +++-- lisp/filenotify.el | 4 +++- test/lisp/filenotify-tests.el | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index e3297b1be7c..db986178dd8 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -3124,8 +3124,9 @@ watch for file attribute changes, like permissions or modification time @end table -If @var{file} is a directory, changes for all files in that directory -will be notified. This does not work recursively. +If @var{file} is a directory, @code{change} watches for file creation +or deletion in that directory. Some of the file notification backends +report also file changes. This does not work recursively. When any event happens, Emacs will call the @var{callback} function passing it a single argument @var{event}, which is of the form diff --git a/lisp/filenotify.el b/lisp/filenotify.el index e0dceb704d5..271fa270836 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -390,7 +390,9 @@ include the following symbols: permissions or modification time If FILE is a directory, `change' watches for file creation or -deletion in that directory. This does not work recursively. +deletion in that directory. Some of the file notification +backends report also file changes. This does not work +recursively. When any event happens, Emacs will call the CALLBACK function passing it a single argument EVENT, which is of the form diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 6125069c6b3..9be515ab176 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -743,7 +743,7 @@ delivered." ;; the directory. Except for ;; GFam{File,Directory}Monitor, GPollFileMonitor and ;; kqueue. And GFam{File,Directory}Monitor and - ;; GPollFileMonitordo not raise a `changed' event. + ;; GPollFileMonitor do not raise a `changed' event. ((memq (file-notify--test-monitor) '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor)) '(created deleted stopped)) -- 2.39.2