Subject: bug#26126: 26.0.50; file-notify-rm-watch removes arbitrary watches

From: Michael Albinus <[email-masked]>
Date: Thu, 23 Mar 2017 08:36:39 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Michael Albinus <[email-masked]>
>> Date: Wed, 22 Mar 2017 19:57:10 +0100
>> Cc: [email-masked]
>> 
>> > This touches the question whether we're operating under the assumption,
>> > that other Lisp-code (apart from filenotify.el) may freely call
>> > inotify-add-watch or not.  Because if it does, this has to be handled in
>> > inotify.c.  Otherwise we may handle it in filenotify.el .
>> 
>> It is still possible to call inotify-add-watch and companions. However,
>> we don't force this use; the Elisp manual decribes only filenoty.el
>> functionality.
>
> IMO, Lisp programs should always go through filenotify.el, never via
> backend-specific APIs.

Then we shall emphasize this in the manual. Like this?

--8<---------------cut here---------------start------------->8---
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 9b6752c..09f7c18 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -2707,7 +2707,8 @@ File Notifications
 
 Since all these libraries emit different events on notified file
 changes, there is the Emacs library @code{filenotify} which provides a
-unique interface.
+unified interface.  It is highly recommended to use this library
+instead of the native ones.
 
 @defun file-notify-add-watch file flags callback
 Add a watch for filesystem events pertaining to @var{file}.  This
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.