diff options
| author | Michael Albinus | 2023-10-10 19:51:22 +0200 |
|---|---|---|
| committer | Michael Albinus | 2023-10-10 19:51:22 +0200 |
| commit | f7185ca29b5086b1b0f32e64b7a5ba0bc21152c8 (patch) | |
| tree | d49081a3d1523e43beb3deea51eeec3a9562f13a | |
| parent | 294567d171c9f1fbc961ea43c899269f46140570 (diff) | |
| download | emacs-f7185ca29b5086b1b0f32e64b7a5ba0bc21152c8.tar.gz emacs-f7185ca29b5086b1b0f32e64b7a5ba0bc21152c8.zip | |
File notifications report unmount events (bug#66381)
* doc/lispref/os.texi (File Notifications): Unmounting a watched
filesystem is reported now.
* etc/NEWS: File notifications report unmount events now.
Fix typos.
* lisp/filenotify.el (file-notify--callback-inotify)
(file-notify--add-watch-inotify): Handle `unmount'.
(file-notify--callback-kqueue, file-notify--add-watch-kqueue):
Handle `revoke'.
(file-notify--callback-gfilenotify): Handle `unmounted'.
(file-notify-callback): Handle `unmount' and `unmounted'.
(file-notify--add-watch-inotify):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
Handle `unmounted'.
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Handle `unmount' and `unmounted'.
* src/gfilenotify.c (dir_monitor_callback): Handle Qunmounted.
* src/inotify.c (symbol_to_inotifymask): Handle IN_IGNORED and
IN_UNMOUNT.
* src/kqueue.c (kqueue_callback, Fkqueue_add_watch):
Handle NOTE_REVOKE.
(Fkqueue_add_watch): Adapt docstring.
(syms_of_kqueue): Declare `revoke.
| -rw-r--r-- | doc/lispref/os.texi | 3 | ||||
| -rw-r--r-- | etc/NEWS | 35 | ||||
| -rw-r--r-- | lisp/filenotify.el | 14 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 13 | ||||
| -rw-r--r-- | src/gfilenotify.c | 8 | ||||
| -rw-r--r-- | src/inotify.c | 5 | ||||
| -rw-r--r-- | src/kqueue.c | 10 |
8 files changed, 59 insertions, 35 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 5400d492f0a..f92709f1f9b 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -3355,7 +3355,8 @@ reliably report file attribute changes when watching a directory. | |||
| 3355 | The @code{stopped} event means that watching the file has been | 3355 | The @code{stopped} event means that watching the file has been |
| 3356 | discontinued. This could be because @code{file-notify-rm-watch} was | 3356 | discontinued. This could be because @code{file-notify-rm-watch} was |
| 3357 | called (see below), or because the file being watched was deleted, or | 3357 | called (see below), or because the file being watched was deleted, or |
| 3358 | due to another error reported from the underlying library which makes | 3358 | because the filesystem of the file being watched was unmounted, or due |
| 3359 | to another error reported from the underlying library which makes | ||
| 3359 | further watching impossible. | 3360 | further watching impossible. |
| 3360 | 3361 | ||
| 3361 | @var{file} and @var{file1} are the name of the file(s) whose event is | 3362 | @var{file} and @var{file1} are the name of the file(s) whose event is |
| @@ -144,9 +144,7 @@ can use this to distinguish between buffers visiting files with the | |||
| 144 | same base name that belong to different projects by using the provided | 144 | same base name that belong to different projects by using the provided |
| 145 | transform function 'project-uniquify-dirname-transform'. | 145 | transform function 'project-uniquify-dirname-transform'. |
| 146 | 146 | ||
| 147 | ** 'insert-directory-program' is now a defcustom. | 147 | ** 'insert-directory-program' is now a user option. |
| 148 | |||
| 149 | ** 'insert-directory-program' prefers "gls" on *BSD and macOS. | ||
| 150 | On *BSD and macOS systems, this user option now defaults to the "gls" | 148 | On *BSD and macOS systems, this user option now defaults to the "gls" |
| 151 | executable, if it exists. This should remove the need to change its | 149 | executable, if it exists. This should remove the need to change its |
| 152 | value when installing GNU coreutils using something like ports or | 150 | value when installing GNU coreutils using something like ports or |
| @@ -267,6 +265,7 @@ functions in CJK locales. | |||
| 267 | * Changes in Specialized Modes and Packages in Emacs 30.1 | 265 | * Changes in Specialized Modes and Packages in Emacs 30.1 |
| 268 | 266 | ||
| 269 | ** gdb-mi | 267 | ** gdb-mi |
| 268 | |||
| 270 | --- | 269 | --- |
| 271 | *** Variable order and truncation can now be configured in 'gdb-many-windows'. | 270 | *** Variable order and truncation can now be configured in 'gdb-many-windows'. |
| 272 | The new user option 'gdb-locals-table-row-config' allows users to | 271 | The new user option 'gdb-locals-table-row-config' allows users to |
| @@ -285,7 +284,7 @@ If you want to get back the old behavior, set the user option to the value | |||
| 285 | 284 | ||
| 286 | --- | 285 | --- |
| 287 | *** New user option 'gdb-display-io-buffer'. | 286 | *** New user option 'gdb-display-io-buffer'. |
| 288 | If this is nil, "M-x gdb" will neither create nor display a separate | 287 | If this is nil, 'M-x gdb' will neither create nor display a separate |
| 289 | buffer for the I/O of the program being debugged, but will instead | 288 | buffer for the I/O of the program being debugged, but will instead |
| 290 | redirect the program's interaction to the GDB execution buffer. The | 289 | redirect the program's interaction to the GDB execution buffer. The |
| 291 | default is t, to preserve previous behavior. | 290 | default is t, to preserve previous behavior. |
| @@ -299,9 +298,9 @@ equivalent to the "--heading" option of some tools such as 'git grep' | |||
| 299 | and 'rg'. The headings are displayed using the new 'grep-heading' | 298 | and 'rg'. The headings are displayed using the new 'grep-heading' |
| 300 | face. | 299 | face. |
| 301 | 300 | ||
| 302 | --- | ||
| 303 | ** Compilation mode | 301 | ** Compilation mode |
| 304 | 302 | ||
| 303 | --- | ||
| 305 | *** The 'omake' matching rule is now disabled by default. | 304 | *** The 'omake' matching rule is now disabled by default. |
| 306 | This is because it partly acts by modifying other rules which may | 305 | This is because it partly acts by modifying other rules which may |
| 307 | occasionally be surprising. It can be re-enabled by adding 'omake' to | 306 | occasionally be surprising. It can be re-enabled by adding 'omake' to |
| @@ -548,6 +547,11 @@ buffer must either visit a file, or it must run 'dired-mode'. Another | |||
| 548 | method but "sudo" can be configured with user option | 547 | method but "sudo" can be configured with user option |
| 549 | 'tramp-file-name-with-method'. | 548 | 'tramp-file-name-with-method'. |
| 550 | 549 | ||
| 550 | ** File Notifications | ||
| 551 | |||
| 552 | +++ | ||
| 553 | *** All backends except w32notify detect unmounting of a watched filesystem now. | ||
| 554 | |||
| 551 | ** EWW | 555 | ** EWW |
| 552 | 556 | ||
| 553 | +++ | 557 | +++ |
| @@ -809,7 +813,8 @@ You can now configure how a thumbnail is named using this option. | |||
| 809 | 813 | ||
| 810 | ** ERT | 814 | ** ERT |
| 811 | 815 | ||
| 812 | *** New macro `skip-when' to skip 'ert-deftest' tests. | 816 | +++ |
| 817 | *** New macro 'skip-when' to skip 'ert-deftest' tests. | ||
| 813 | This can help avoid some awkward skip conditions. For example | 818 | This can help avoid some awkward skip conditions. For example |
| 814 | '(skip-unless (not noninteractive))' can be changed to the easier | 819 | '(skip-unless (not noninteractive))' can be changed to the easier |
| 815 | to read '(skip-when noninteractive)'. | 820 | to read '(skip-when noninteractive)'. |
| @@ -831,18 +836,19 @@ neither of which have been supported by Emacs since version 23.1. | |||
| 831 | The user option 'url-gateway-nslookup-program' and the function | 836 | The user option 'url-gateway-nslookup-program' and the function |
| 832 | 'url-gateway-nslookup-host' are consequently also obsolete. | 837 | 'url-gateway-nslookup-host' are consequently also obsolete. |
| 833 | 838 | ||
| 834 | +++ | ||
| 835 | ** Edmacro | 839 | ** Edmacro |
| 836 | 840 | ||
| 841 | +++ | ||
| 837 | *** New command 'edmacro-set-macro-to-region-lines'. | 842 | *** New command 'edmacro-set-macro-to-region-lines'. |
| 838 | Bound to 'C-c C-r', this command replaces the macro text with the | 843 | Bound to 'C-c C-r', this command replaces the macro text with the |
| 839 | lines of the region. If needed, the region is extended to include | 844 | lines of the region. If needed, the region is extended to include |
| 840 | whole lines. If the region ends at the beginning of a line, that last | 845 | whole lines. If the region ends at the beginning of a line, that last |
| 841 | line is excluded. | 846 | line is excluded. |
| 842 | 847 | ||
| 848 | +++ | ||
| 843 | *** New user option 'edmacro-reverse-macro-lines'. | 849 | *** New user option 'edmacro-reverse-macro-lines'. |
| 844 | When this is non-nil, the lines of key sequences are displayed with | 850 | When this is non-nil, the lines of key sequences are displayed with |
| 845 | the most recent line fist. This is can be useful when working with | 851 | the most recent line first. This is can be useful when working with |
| 846 | macros with many lines, such as from 'kmacro-edit-lossage'. | 852 | macros with many lines, such as from 'kmacro-edit-lossage'. |
| 847 | 853 | ||
| 848 | 854 | ||
| @@ -861,8 +867,11 @@ A major mode based on the tree-sitter library for editing HEEx files. | |||
| 861 | 867 | ||
| 862 | --- | 868 | --- |
| 863 | *** New major mode 'elixir-ts-mode'. | 869 | *** New major mode 'elixir-ts-mode'. |
| 864 | A major mode based on the tree-sitter library for editing Elixir | 870 | A major mode based on the tree-sitter library for editing Elixir files. |
| 865 | files. | 871 | |
| 872 | --- | ||
| 873 | *** New major mode 'lua-ts-mode'. | ||
| 874 | A major mode based on the tree-sitter library for editing Lua files. | ||
| 866 | 875 | ||
| 867 | +++ | 876 | +++ |
| 868 | ** New global minor mode 'minibuffer-regexp-mode'. | 877 | ** New global minor mode 'minibuffer-regexp-mode'. |
| @@ -872,10 +881,6 @@ a user-friendly way, avoids reporting alleged paren mismatches and makes | |||
| 872 | sexp navigation more intuitive. | 881 | sexp navigation more intuitive. |
| 873 | 882 | ||
| 874 | --- | 883 | --- |
| 875 | *** New major mode 'lua-ts-mode'. | ||
| 876 | A major mode based on the tree-sitter library for editing Lua files. | ||
| 877 | |||
| 878 | --- | ||
| 879 | ** The highly accessible Modus themes collection has eight items. | 884 | ** The highly accessible Modus themes collection has eight items. |
| 880 | The 'modus-operandi' and 'modus-vivendi' are the main themes that have | 885 | The 'modus-operandi' and 'modus-vivendi' are the main themes that have |
| 881 | been part of Emacs since version 28. The former is light, the latter | 886 | been part of Emacs since version 28. The former is light, the latter |
| @@ -913,7 +918,7 @@ the file listing's performance is still optimized. | |||
| 913 | 918 | ||
| 914 | * Incompatible Lisp Changes in Emacs 30.1 | 919 | * Incompatible Lisp Changes in Emacs 30.1 |
| 915 | 920 | ||
| 916 | ** 'post-gc-hook' runs after updating 'gcs-done' and `'gcs-elapsed'. | 921 | ** 'post-gc-hook' runs after updating 'gcs-done' and 'gcs-elapsed'. |
| 917 | 922 | ||
| 918 | --- | 923 | --- |
| 919 | ** The escape sequence '\x' not followed by hex digits is now an error. | 924 | ** The escape sequence '\x' not followed by hex digits is now an error. |
diff --git a/lisp/filenotify.el b/lisp/filenotify.el index e9f8d4e515d..03bd4e51485 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el | |||
| @@ -138,7 +138,7 @@ It is nil or a `file-notify--rename' defstruct where the cookie can be nil.") | |||
| 138 | ((memq action '(delete delete-self move-self)) 'deleted) | 138 | ((memq action '(delete delete-self move-self)) 'deleted) |
| 139 | ((eq action 'moved-from) 'renamed-from) | 139 | ((eq action 'moved-from) 'renamed-from) |
| 140 | ((eq action 'moved-to) 'renamed-to) | 140 | ((eq action 'moved-to) 'renamed-to) |
| 141 | ((eq action 'ignored) 'stopped))) | 141 | ((memq action '(ignored unmount)) 'stopped))) |
| 142 | actions)) | 142 | actions)) |
| 143 | file file1-or-cookie)) | 143 | file file1-or-cookie)) |
| 144 | 144 | ||
| @@ -153,7 +153,8 @@ It is nil or a `file-notify--rename' defstruct where the cookie can be nil.") | |||
| 153 | ((eq action 'write) 'changed) | 153 | ((eq action 'write) 'changed) |
| 154 | ((memq action '(attrib link)) 'attribute-changed) | 154 | ((memq action '(attrib link)) 'attribute-changed) |
| 155 | ((eq action 'delete) 'deleted) | 155 | ((eq action 'delete) 'deleted) |
| 156 | ((eq action 'rename) 'renamed))) | 156 | ((eq action 'rename) 'renamed) |
| 157 | ((eq action 'revoke) 'stopped))) | ||
| 157 | actions)) | 158 | actions)) |
| 158 | file file1-or-cookie)) | 159 | file file1-or-cookie)) |
| 159 | 160 | ||
| @@ -179,7 +180,8 @@ It is nil or a `file-notify--rename' defstruct where the cookie can be nil.") | |||
| 179 | ((memq action | 180 | ((memq action |
| 180 | '(created changed attribute-changed deleted)) | 181 | '(created changed attribute-changed deleted)) |
| 181 | action) | 182 | action) |
| 182 | ((eq action 'moved) 'renamed))) | 183 | ((eq action 'moved) 'renamed) |
| 184 | ((eq action 'unmounted) 'stopped))) | ||
| 183 | (if (consp actions) actions (list actions)))) | 185 | (if (consp actions) actions (list actions)))) |
| 184 | file file1-or-cookie)) | 186 | file file1-or-cookie)) |
| 185 | 187 | ||
| @@ -195,6 +197,7 @@ It is nil or a `file-notify--rename' defstruct where the cookie can be nil.") | |||
| 195 | ((memq action '(created changed attribute-changed deleted)) | 197 | ((memq action '(created changed attribute-changed deleted)) |
| 196 | action) | 198 | action) |
| 197 | ((eq action 'moved) 'renamed) | 199 | ((eq action 'moved) 'renamed) |
| 200 | ((eq action 'unmounted) 'stopped) | ||
| 198 | ;; inotify actions: | 201 | ;; inotify actions: |
| 199 | ((eq action 'create) 'created) | 202 | ((eq action 'create) 'created) |
| 200 | ((eq action 'modify) 'changed) | 203 | ((eq action 'modify) 'changed) |
| @@ -202,7 +205,7 @@ It is nil or a `file-notify--rename' defstruct where the cookie can be nil.") | |||
| 202 | ((memq action '(delete delete-self move-self)) 'deleted) | 205 | ((memq action '(delete delete-self move-self)) 'deleted) |
| 203 | ((eq action 'moved-from) 'renamed-from) | 206 | ((eq action 'moved-from) 'renamed-from) |
| 204 | ((eq action 'moved-to) 'renamed-to) | 207 | ((eq action 'moved-to) 'renamed-to) |
| 205 | ((eq action 'ignored) 'stopped))) | 208 | ((memq action '(ignored unmount)) 'stopped))) |
| 206 | (if (consp actions) actions (list actions)))) | 209 | (if (consp actions) actions (list actions)))) |
| 207 | file file1-or-cookie)) | 210 | file file1-or-cookie)) |
| 208 | 211 | ||
| @@ -339,7 +342,7 @@ DESC is the back-end descriptor. ACTIONS is a list of: | |||
| 339 | "Add a watch for FILE in DIR with FLAGS, using inotify." | 342 | "Add a watch for FILE in DIR with FLAGS, using inotify." |
| 340 | (inotify-add-watch dir | 343 | (inotify-add-watch dir |
| 341 | (append | 344 | (append |
| 342 | '(dont-follow) | 345 | '(dont-follow ignored unmount) |
| 343 | (and (memq 'change flags) | 346 | (and (memq 'change flags) |
| 344 | '(create delete delete-self modify move-self move)) | 347 | '(create delete delete-self modify move-self move)) |
| 345 | (and (memq 'attribute-change flags) | 348 | (and (memq 'attribute-change flags) |
| @@ -352,6 +355,7 @@ DESC is the back-end descriptor. ACTIONS is a list of: | |||
| 352 | ;; directories, so we watch each file directly. | 355 | ;; directories, so we watch each file directly. |
| 353 | (kqueue-add-watch file | 356 | (kqueue-add-watch file |
| 354 | (append | 357 | (append |
| 358 | '(revoke) | ||
| 355 | (and (memq 'change flags) | 359 | (and (memq 'change flags) |
| 356 | '(create delete write extend rename)) | 360 | '(create delete write extend rename)) |
| 357 | (and (memq 'attribute-change flags) | 361 | (and (memq 'attribute-change flags) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 577760f806c..227571b148b 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -1490,10 +1490,10 @@ If FILE-SYSTEM is non-nil, return file system attributes." | |||
| 1490 | (cond | 1490 | (cond |
| 1491 | ((and (memq 'change flags) (memq 'attribute-change flags)) | 1491 | ((and (memq 'change flags) (memq 'attribute-change flags)) |
| 1492 | '(created changed changes-done-hint moved deleted | 1492 | '(created changed changes-done-hint moved deleted |
| 1493 | attribute-changed)) | 1493 | attribute-changed unmounted)) |
| 1494 | ((memq 'change flags) | 1494 | ((memq 'change flags) |
| 1495 | '(created changed changes-done-hint moved deleted)) | 1495 | '(created changed changes-done-hint moved deleted unmounted)) |
| 1496 | ((memq 'attribute-change flags) '(attribute-changed)))) | 1496 | ((memq 'attribute-change flags) '(attribute-changed unmounted)))) |
| 1497 | (p (apply | 1497 | (p (apply |
| 1498 | #'start-process | 1498 | #'start-process |
| 1499 | "gvfs-monitor" (generate-new-buffer " *gvfs-monitor*") | 1499 | "gvfs-monitor" (generate-new-buffer " *gvfs-monitor*") |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 95c27626166..4a5840cca4c 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -3802,11 +3802,12 @@ Fall back to normal file name handler if no Tramp handler exists." | |||
| 3802 | (cond | 3802 | (cond |
| 3803 | ((and (memq 'change flags) (memq 'attribute-change flags)) | 3803 | ((and (memq 'change flags) (memq 'attribute-change flags)) |
| 3804 | (concat "create,modify,move,moved_from,moved_to,move_self," | 3804 | (concat "create,modify,move,moved_from,moved_to,move_self," |
| 3805 | "delete,delete_self,attrib,ignored")) | 3805 | "delete,delete_self,attrib")) |
| 3806 | ((memq 'change flags) | 3806 | ((memq 'change flags) |
| 3807 | (concat "create,modify,move,moved_from,moved_to,move_self," | 3807 | (concat "create,modify,move,moved_from,moved_to,move_self," |
| 3808 | "delete,delete_self,ignored")) | 3808 | "delete,delete_self")) |
| 3809 | ((memq 'attribute-change flags) "attrib,ignored")) | 3809 | ((memq 'attribute-change flags) "attrib")) |
| 3810 | events (concat events ",ignored,unmount") | ||
| 3810 | ;; "-P" has been added to version 3.21, so we cannot assume it yet. | 3811 | ;; "-P" has been added to version 3.21, so we cannot assume it yet. |
| 3811 | sequence `(,command "-mq" "-e" ,events ,localname) | 3812 | sequence `(,command "-mq" "-e" ,events ,localname) |
| 3812 | ;; Make events a list of symbols. | 3813 | ;; Make events a list of symbols. |
| @@ -3821,10 +3822,10 @@ Fall back to normal file name handler if no Tramp handler exists." | |||
| 3821 | (cond | 3822 | (cond |
| 3822 | ((and (memq 'change flags) (memq 'attribute-change flags)) | 3823 | ((and (memq 'change flags) (memq 'attribute-change flags)) |
| 3823 | '(created changed changes-done-hint moved deleted | 3824 | '(created changed changes-done-hint moved deleted |
| 3824 | attribute-changed)) | 3825 | attribute-changed unmounted)) |
| 3825 | ((memq 'change flags) | 3826 | ((memq 'change flags) |
| 3826 | '(created changed changes-done-hint moved deleted)) | 3827 | '(created changed changes-done-hint moved deleted unmounted)) |
| 3827 | ((memq 'attribute-change flags) '(attribute-changed))) | 3828 | ((memq 'attribute-change flags) '(attribute-changed unmounted))) |
| 3828 | sequence `(,command "monitor" ,localname))) | 3829 | sequence `(,command "monitor" ,localname))) |
| 3829 | ;; None. | 3830 | ;; None. |
| 3830 | (t (tramp-error | 3831 | (t (tramp-error |
diff --git a/src/gfilenotify.c b/src/gfilenotify.c index de09ffe5fd3..3dd6390db10 100644 --- a/src/gfilenotify.c +++ b/src/gfilenotify.c | |||
| @@ -88,7 +88,9 @@ dir_monitor_callback (GFileMonitor *monitor, | |||
| 88 | && !NILP (Fmember (symbol, list5 (Qchanged, Qchanges_done_hint, | 88 | && !NILP (Fmember (symbol, list5 (Qchanged, Qchanges_done_hint, |
| 89 | Qdeleted, Qcreated, Qmoved)))) | 89 | Qdeleted, Qcreated, Qmoved)))) |
| 90 | || (!NILP (Fmember (Qattribute_change, flags)) | 90 | || (!NILP (Fmember (Qattribute_change, flags)) |
| 91 | && EQ (symbol, Qattribute_changed))) | 91 | && EQ (symbol, Qattribute_changed)) |
| 92 | || (!NILP (Fmember (Qwatch_mounts, flags)) | ||
| 93 | && EQ (symbol, Qunmounted))) | ||
| 92 | { | 94 | { |
| 93 | /* Construct an event. */ | 95 | /* Construct an event. */ |
| 94 | EVENT_INIT (event); | 96 | EVENT_INIT (event); |
| @@ -105,8 +107,8 @@ dir_monitor_callback (GFileMonitor *monitor, | |||
| 105 | /* XD_DEBUG_MESSAGE ("%s", XD_OBJECT_TO_STRING (event.arg)); */ | 107 | /* XD_DEBUG_MESSAGE ("%s", XD_OBJECT_TO_STRING (event.arg)); */ |
| 106 | } | 108 | } |
| 107 | 109 | ||
| 108 | /* Cancel monitor if file or directory is deleted. */ | 110 | /* Cancel monitor if file or directory is deleted or unmounted. */ |
| 109 | if (!NILP (Fmember (symbol, list2 (Qdeleted, Qmoved))) | 111 | if (!NILP (Fmember (symbol, list3 (Qdeleted, Qmoved, Qunmounted))) |
| 110 | && strcmp (name, SSDATA (XCAR (XCDR (watch_object)))) == 0 | 112 | && strcmp (name, SSDATA (XCAR (XCDR (watch_object)))) == 0 |
| 111 | && !g_file_monitor_is_cancelled (monitor)) | 113 | && !g_file_monitor_is_cancelled (monitor)) |
| 112 | g_file_monitor_cancel (monitor); | 114 | g_file_monitor_cancel (monitor); |
diff --git a/src/inotify.c b/src/inotify.c index 105ff5a9d8a..247d9f03055 100644 --- a/src/inotify.c +++ b/src/inotify.c | |||
| @@ -148,6 +148,11 @@ symbol_to_inotifymask (Lisp_Object symb) | |||
| 148 | else if (EQ (symb, Qonlydir)) | 148 | else if (EQ (symb, Qonlydir)) |
| 149 | return IN_ONLYDIR; | 149 | return IN_ONLYDIR; |
| 150 | 150 | ||
| 151 | else if (EQ (symb, Qignored)) | ||
| 152 | return IN_IGNORED; | ||
| 153 | else if (EQ (symb, Qunmount)) | ||
| 154 | return IN_UNMOUNT; | ||
| 155 | |||
| 151 | else if (EQ (symb, Qt) || EQ (symb, Qall_events)) | 156 | else if (EQ (symb, Qt) || EQ (symb, Qall_events)) |
| 152 | return IN_ALL_EVENTS; | 157 | return IN_ALL_EVENTS; |
| 153 | else | 158 | else |
diff --git a/src/kqueue.c b/src/kqueue.c index 22c279b7ce3..43d5f40624b 100644 --- a/src/kqueue.c +++ b/src/kqueue.c | |||
| @@ -320,13 +320,16 @@ kqueue_callback (int fd, void *data) | |||
| 320 | directory is monitored. */ | 320 | directory is monitored. */ |
| 321 | if (kev.fflags & NOTE_RENAME) | 321 | if (kev.fflags & NOTE_RENAME) |
| 322 | actions = Fcons (Qrename, actions); | 322 | actions = Fcons (Qrename, actions); |
| 323 | if (kev.fflags & NOTE_REVOKE) | ||
| 324 | actions = Fcons (Qrevoke, actions); | ||
| 323 | 325 | ||
| 324 | /* Create the event. */ | 326 | /* Create the event. */ |
| 325 | if (! NILP (actions)) | 327 | if (! NILP (actions)) |
| 326 | kqueue_generate_event (watch_object, actions, file, Qnil); | 328 | kqueue_generate_event (watch_object, actions, file, Qnil); |
| 327 | 329 | ||
| 328 | /* Cancel monitor if file or directory is deleted or renamed. */ | 330 | /* Cancel monitor if file or directory is deleted or renamed or |
| 329 | if (kev.fflags & (NOTE_DELETE | NOTE_RENAME)) | 331 | the file system is unmounted. */ |
| 332 | if (kev.fflags & (NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE)) | ||
| 330 | Fkqueue_rm_watch (descriptor); | 333 | Fkqueue_rm_watch (descriptor); |
| 331 | } | 334 | } |
| 332 | return; | 335 | return; |
| @@ -351,6 +354,7 @@ following symbols: | |||
| 351 | `attrib' -- a FILE attribute was changed | 354 | `attrib' -- a FILE attribute was changed |
| 352 | `link' -- a FILE's link count was changed | 355 | `link' -- a FILE's link count was changed |
| 353 | `rename' -- FILE was moved to FILE1 | 356 | `rename' -- FILE was moved to FILE1 |
| 357 | `revoke' -- FILE was unmounted | ||
| 354 | 358 | ||
| 355 | When any event happens, Emacs will call the CALLBACK function passing | 359 | When any event happens, Emacs will call the CALLBACK function passing |
| 356 | it a single argument EVENT, which is of the form | 360 | it a single argument EVENT, which is of the form |
| @@ -437,6 +441,7 @@ only when the upper directory of the renamed file is watched. */) | |||
| 437 | if (! NILP (Fmember (Qattrib, flags))) fflags |= NOTE_ATTRIB; | 441 | if (! NILP (Fmember (Qattrib, flags))) fflags |= NOTE_ATTRIB; |
| 438 | if (! NILP (Fmember (Qlink, flags))) fflags |= NOTE_LINK; | 442 | if (! NILP (Fmember (Qlink, flags))) fflags |= NOTE_LINK; |
| 439 | if (! NILP (Fmember (Qrename, flags))) fflags |= NOTE_RENAME; | 443 | if (! NILP (Fmember (Qrename, flags))) fflags |= NOTE_RENAME; |
| 444 | if (! NILP (Fmember (Qrevoke, flags))) fflags |= NOTE_REVOKE; | ||
| 440 | 445 | ||
| 441 | /* Register event. */ | 446 | /* Register event. */ |
| 442 | EV_SET (&kev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, | 447 | EV_SET (&kev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, |
| @@ -526,6 +531,7 @@ syms_of_kqueue (void) | |||
| 526 | DEFSYM (Qattrib, "attrib"); /* NOTE_ATTRIB */ | 531 | DEFSYM (Qattrib, "attrib"); /* NOTE_ATTRIB */ |
| 527 | DEFSYM (Qlink, "link"); /* NOTE_LINK */ | 532 | DEFSYM (Qlink, "link"); /* NOTE_LINK */ |
| 528 | DEFSYM (Qrename, "rename"); /* NOTE_RENAME */ | 533 | DEFSYM (Qrename, "rename"); /* NOTE_RENAME */ |
| 534 | DEFSYM (Qrevoke, "revoke"); /* NOTE_REVOKE */ | ||
| 529 | 535 | ||
| 530 | staticpro (&watch_list); | 536 | staticpro (&watch_list); |
| 531 | 537 | ||