aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-04-20 20:00:15 +0300
committerEli Zaretskii2022-04-20 20:00:15 +0300
commitdbb2dd6939867abe50c0894be9ba4e09c96f6759 (patch)
treea35166886fd4e3b002a9e6c990932fb3d03e0f9f
parente6c2a2497d8cc8c38c816507681d5d529cfdbf2e (diff)
downloademacs-dbb2dd6939867abe50c0894be9ba4e09c96f6759.tar.gz
emacs-dbb2dd6939867abe50c0894be9ba4e09c96f6759.zip
; Fix wording of "File Notifications" in the ELisp manual
* doc/lispref/os.texi (File Notifications): Fix typos, punctuation, and wording.
-rw-r--r--doc/lispref/os.texi57
1 files changed, 30 insertions, 27 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 96cfff3f89b..e7ce40b1f25 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -3088,21 +3088,21 @@ This function removes the tray notification given by its unique
3088@cindex watch, for filesystem events 3088@cindex watch, for filesystem events
3089 3089
3090Several operating systems support watching of filesystems for changes 3090Several operating systems support watching of filesystems for changes
3091of files. If configured properly, Emacs links a respective library 3091to files or their attributes. If configured properly, Emacs links a
3092like @file{inotify}, @file{kqueue}, @file{gfilenotify}, or 3092respective library like @file{inotify}, @file{kqueue},
3093@file{w32notify} statically. These libraries enable watching of 3093@file{gfilenotify}, or @file{w32notify} statically. These libraries
3094filesystems on the local machine. 3094enable watching of filesystems on the local machine.
3095 3095
3096It is also possible to watch filesystems on remote machines, 3096It is also possible to watch filesystems on remote machines,
3097@pxref{Remote Files,, Remote Files, emacs, The GNU Emacs Manual} 3097@pxref{Remote Files,, Remote Files, emacs, The GNU Emacs Manual}.
3098This does not depend on one of the libraries linked to Emacs. 3098This does not depend on one of the libraries linked to Emacs.
3099 3099
3100Since all these libraries emit different events on notified file 3100Since all these libraries emit different events upon notified file
3101changes, there is the Emacs library @code{filenotify} which provides a 3101changes, Emacs provides a special library @code{filenotify} which
3102unified interface. Lisp programs that want to receive file 3102presents a unified interface to applications. Lisp programs that want
3103notifications should always use this library in preference to the 3103to receive file notifications should always use this library in
3104native ones. 3104preference to the native ones. This section documents the
3105 3105@code{filenotify} library functions and variables.
3106 3106
3107@defun file-notify-add-watch file flags callback 3107@defun file-notify-add-watch file flags callback
3108Add a watch for filesystem events pertaining to @var{file}. This 3108Add a watch for filesystem events pertaining to @var{file}. This
@@ -3110,31 +3110,33 @@ arranges for filesystem events pertaining to @var{file} to be reported
3110to Emacs. 3110to Emacs.
3111 3111
3112The returned value is a descriptor for the added watch. Its type 3112The returned value is a descriptor for the added watch. Its type
3113depends on the underlying library, it cannot be assumed to be an 3113depends on the underlying library, and in general cannot be assumed to
3114integer as in the example below. It should be used for comparison by 3114be an integer as in the example below. It should be used for
3115@code{equal} only. 3115comparison by @code{equal} only.
3116 3116
3117If the @var{file} cannot be watched for some reason, this function 3117If the @var{file} cannot be watched for some reason, this function
3118signals a @code{file-notify-error} error. 3118signals a @code{file-notify-error} error.
3119 3119
3120Sometimes, mounted filesystems cannot be watched for file changes. 3120Sometimes, mounted filesystems cannot be watched for file changes.
3121This is not detected by this function, a non-@code{nil} return value 3121This is not detected by this function, and so a non-@code{nil} return
3122does not guarantee that changes on @var{file} will be notified. 3122value does not guarantee that changes on @var{file} will be actually
3123notified.
3123 3124
3124@var{flags} is a list of conditions to set what will be watched for. 3125@var{flags} is a list of conditions to set what will be watched for.
3125It can include the following symbols: 3126It can include the following symbols:
3126 3127
3127@table @code 3128@table @code
3128@item change 3129@item change
3129watch for file changes 3130watch for changes in file's contents
3130@item attribute-change 3131@item attribute-change
3131watch for file attribute changes, like permissions or modification 3132watch for changes in file attributes, like permissions or modification
3132time 3133time
3133@end table 3134@end table
3134 3135
3135If @var{file} is a directory, @code{change} watches for file creation 3136If @var{file} is a directory, @code{change} watches for file creation
3136or deletion in that directory. Some of the file notification backends 3137and deletion in that directory. Some of the native file notification
3137report also file changes. This does not work recursively. 3138libraries also report file changes in that case. This does not work
3139recursively.
3138 3140
3139When any event happens, Emacs will call the @var{callback} function 3141When any event happens, Emacs will call the @var{callback} function
3140passing it a single argument @var{event}, which is of the form 3142passing it a single argument @var{event}, which is of the form
@@ -3160,19 +3162,20 @@ reports attribute changes as well
3160@item attribute-changed 3162@item attribute-changed
3161a @var{file} attribute was changed 3163a @var{file} attribute was changed
3162@item stopped 3164@item stopped
3163watching @var{file} has been stopped 3165watching @var{file} has stopped
3164@end table 3166@end table
3165 3167
3166Note that the @file{w32notify} library does not report 3168Note that the @file{w32notify} library does not report
3167@code{attribute-changed} events. When some file's attribute, like 3169@code{attribute-changed} events. When some file's attribute, like
3168permissions or modification time, has changed, this library reports a 3170permissions or modification time, has changed, this library reports a
3169@code{changed} event. Likewise, the @file{kqueue} library does not 3171@code{changed} event. Likewise, the @file{kqueue} library does not
3170report reliably file attribute changes when watching a directory. 3172reliably report file attribute changes when watching a directory.
3171 3173
3172The @code{stopped} event reports, that watching the file has been 3174The @code{stopped} event means that watching the file has been
3173stopped. This could be because @code{file-notify-rm-watch} was called 3175discontinued. This could be because @code{file-notify-rm-watch} was
3174(see below), or because the file being watched was deleted, or due to 3176called (see below), or because the file being watched was deleted, or
3175another error reported from the underlying library. 3177due to another error reported from the underlying library which makes
3178further watching impossible.
3176 3179
3177@var{file} and @var{file1} are the name of the file(s) whose event is 3180@var{file} and @var{file1} are the name of the file(s) whose event is
3178being reported. For example: 3181being reported. For example:
@@ -3216,7 +3219,7 @@ being reported. For example:
3216@end group 3219@end group
3217@end example 3220@end example
3218 3221
3219Whether the action @code{renamed} is returned, depends on the used 3222Whether the action @code{renamed} is returned depends on the used
3220watch library. Otherwise, the actions @code{deleted} and 3223watch library. Otherwise, the actions @code{deleted} and
3221@code{created} could be returned in a random order. 3224@code{created} could be returned in a random order.
3222 3225