diff options
| author | Eli Zaretskii | 2022-04-20 20:00:15 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-04-20 20:00:15 +0300 |
| commit | dbb2dd6939867abe50c0894be9ba4e09c96f6759 (patch) | |
| tree | a35166886fd4e3b002a9e6c990932fb3d03e0f9f | |
| parent | e6c2a2497d8cc8c38c816507681d5d529cfdbf2e (diff) | |
| download | emacs-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.texi | 57 |
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 | ||
| 3090 | Several operating systems support watching of filesystems for changes | 3090 | Several operating systems support watching of filesystems for changes |
| 3091 | of files. If configured properly, Emacs links a respective library | 3091 | to files or their attributes. If configured properly, Emacs links a |
| 3092 | like @file{inotify}, @file{kqueue}, @file{gfilenotify}, or | 3092 | respective library like @file{inotify}, @file{kqueue}, |
| 3093 | @file{w32notify} statically. These libraries enable watching of | 3093 | @file{gfilenotify}, or @file{w32notify} statically. These libraries |
| 3094 | filesystems on the local machine. | 3094 | enable watching of filesystems on the local machine. |
| 3095 | 3095 | ||
| 3096 | It is also possible to watch filesystems on remote machines, | 3096 | It 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}. |
| 3098 | This does not depend on one of the libraries linked to Emacs. | 3098 | This does not depend on one of the libraries linked to Emacs. |
| 3099 | 3099 | ||
| 3100 | Since all these libraries emit different events on notified file | 3100 | Since all these libraries emit different events upon notified file |
| 3101 | changes, there is the Emacs library @code{filenotify} which provides a | 3101 | changes, Emacs provides a special library @code{filenotify} which |
| 3102 | unified interface. Lisp programs that want to receive file | 3102 | presents a unified interface to applications. Lisp programs that want |
| 3103 | notifications should always use this library in preference to the | 3103 | to receive file notifications should always use this library in |
| 3104 | native ones. | 3104 | preference 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 |
| 3108 | Add a watch for filesystem events pertaining to @var{file}. This | 3108 | Add 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 | |||
| 3110 | to Emacs. | 3110 | to Emacs. |
| 3111 | 3111 | ||
| 3112 | The returned value is a descriptor for the added watch. Its type | 3112 | The returned value is a descriptor for the added watch. Its type |
| 3113 | depends on the underlying library, it cannot be assumed to be an | 3113 | depends on the underlying library, and in general cannot be assumed to |
| 3114 | integer as in the example below. It should be used for comparison by | 3114 | be an integer as in the example below. It should be used for |
| 3115 | @code{equal} only. | 3115 | comparison by @code{equal} only. |
| 3116 | 3116 | ||
| 3117 | If the @var{file} cannot be watched for some reason, this function | 3117 | If the @var{file} cannot be watched for some reason, this function |
| 3118 | signals a @code{file-notify-error} error. | 3118 | signals a @code{file-notify-error} error. |
| 3119 | 3119 | ||
| 3120 | Sometimes, mounted filesystems cannot be watched for file changes. | 3120 | Sometimes, mounted filesystems cannot be watched for file changes. |
| 3121 | This is not detected by this function, a non-@code{nil} return value | 3121 | This is not detected by this function, and so a non-@code{nil} return |
| 3122 | does not guarantee that changes on @var{file} will be notified. | 3122 | value does not guarantee that changes on @var{file} will be actually |
| 3123 | notified. | ||
| 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. |
| 3125 | It can include the following symbols: | 3126 | It can include the following symbols: |
| 3126 | 3127 | ||
| 3127 | @table @code | 3128 | @table @code |
| 3128 | @item change | 3129 | @item change |
| 3129 | watch for file changes | 3130 | watch for changes in file's contents |
| 3130 | @item attribute-change | 3131 | @item attribute-change |
| 3131 | watch for file attribute changes, like permissions or modification | 3132 | watch for changes in file attributes, like permissions or modification |
| 3132 | time | 3133 | time |
| 3133 | @end table | 3134 | @end table |
| 3134 | 3135 | ||
| 3135 | If @var{file} is a directory, @code{change} watches for file creation | 3136 | If @var{file} is a directory, @code{change} watches for file creation |
| 3136 | or deletion in that directory. Some of the file notification backends | 3137 | and deletion in that directory. Some of the native file notification |
| 3137 | report also file changes. This does not work recursively. | 3138 | libraries also report file changes in that case. This does not work |
| 3139 | recursively. | ||
| 3138 | 3140 | ||
| 3139 | When any event happens, Emacs will call the @var{callback} function | 3141 | When any event happens, Emacs will call the @var{callback} function |
| 3140 | passing it a single argument @var{event}, which is of the form | 3142 | passing 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 |
| 3161 | a @var{file} attribute was changed | 3163 | a @var{file} attribute was changed |
| 3162 | @item stopped | 3164 | @item stopped |
| 3163 | watching @var{file} has been stopped | 3165 | watching @var{file} has stopped |
| 3164 | @end table | 3166 | @end table |
| 3165 | 3167 | ||
| 3166 | Note that the @file{w32notify} library does not report | 3168 | Note 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 |
| 3168 | permissions or modification time, has changed, this library reports a | 3170 | permissions 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 |
| 3170 | report reliably file attribute changes when watching a directory. | 3172 | reliably report file attribute changes when watching a directory. |
| 3171 | 3173 | ||
| 3172 | The @code{stopped} event reports, that watching the file has been | 3174 | The @code{stopped} event means that watching the file has been |
| 3173 | stopped. This could be because @code{file-notify-rm-watch} was called | 3175 | discontinued. This could be because @code{file-notify-rm-watch} was |
| 3174 | (see below), or because the file being watched was deleted, or due to | 3176 | called (see below), or because the file being watched was deleted, or |
| 3175 | another error reported from the underlying library. | 3177 | due to another error reported from the underlying library which makes |
| 3178 | further 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 |
| 3178 | being reported. For example: | 3181 | being 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 | ||
| 3219 | Whether the action @code{renamed} is returned, depends on the used | 3222 | Whether the action @code{renamed} is returned depends on the used |
| 3220 | watch library. Otherwise, the actions @code{deleted} and | 3223 | watch 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 | ||