aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichael Albinus2015-09-20 18:44:36 +0200
committerMichael Albinus2015-09-20 18:44:36 +0200
commitf5bdcb3221ba28326b47210773d84c49cc9b4a1e (patch)
treef316feaf1d548b157ef1a3cfcbb831864e50c003 /doc
parentab11a1cf27ebe3791df45cccde3c851affd184dd (diff)
downloademacs-f5bdcb3221ba28326b47210773d84c49cc9b4a1e.tar.gz
emacs-f5bdcb3221ba28326b47210773d84c49cc9b4a1e.zip
Improve file notifications, especially for Tramp
* doc/lispref/files.texi (Magic File Names): Mention `file-notify-valid-p'. * doc/lispref/os.texi (File Notifications): Describe `file-notify-valid-p'. * etc/NEWS: Add `file-notify-valid-p'. * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch): Improve implementation. (tramp-gvfs-monitor-file-process-filter): Rename from `tramp-gvfs-file-gvfs-monitor-file-process-filter'. Delete process if appropriate. * lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch): Improve implementation. (tramp-sh-gvfs-monitor-dir-process-filter): Rename from `tramp-sh-file-gvfs-monitor-dir-process-filter'. Delete process if appropriate. (tramp-sh-inotifywait-process-filter): Rename from `tramp-sh-file-inotifywait-process-filter'. Delete process if appropriate. * lisp/net/tramp.el (tramp-handle-file-notify-rm-watch): Use `delete-process' (tramp-handle-file-notify-valid-p): Check also, that file or directory to be watched still exists. * test/automated/file-notify-tests.el (file-notify--test-timeout): New defun. Use it at all places a timeout is needed. (file-notify--test-cleanup): Delete directories recursively. Cleanup also Tramp connections. (file-notify-test02-events): Add tests for `attribute-change'. (file-notify-test04-file-validity, file-notify-test05-dir-validity): Add tests for `file-notify-rm-watch'.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/files.texi2
-rw-r--r--doc/lispref/os.texi11
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index ffc7936107b..db2ecc08f95 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2854,6 +2854,7 @@ first, before handlers for jobs such as remote file access.
2854@code{file-name-nondirectory}, 2854@code{file-name-nondirectory},
2855@code{file-name-sans-versions}, @code{file-newer-than-file-p}, 2855@code{file-name-sans-versions}, @code{file-newer-than-file-p},
2856@code{file-notify-add-watch}, @code{file-notify-rm-watch}, 2856@code{file-notify-add-watch}, @code{file-notify-rm-watch},
2857@code{file-notify-valid-p},
2857@code{file-ownership-preserved-p}, 2858@code{file-ownership-preserved-p},
2858@code{file-readable-p}, @code{file-regular-p}, 2859@code{file-readable-p}, @code{file-regular-p},
2859@code{file-remote-p}, @code{file-selinux-context}, 2860@code{file-remote-p}, @code{file-selinux-context},
@@ -2907,6 +2908,7 @@ first, before handlers for jobs such as remote file access.
2907@code{file-name-nondirec@discretionary{}{}{}tory}, 2908@code{file-name-nondirec@discretionary{}{}{}tory},
2908@code{file-name-sans-versions}, @code{file-newer-than-file-p}, 2909@code{file-name-sans-versions}, @code{file-newer-than-file-p},
2909@code{file-notify-add-watch}, @code{file-notify-rm-watch}, 2910@code{file-notify-add-watch}, @code{file-notify-rm-watch},
2911@code{file-notify-valid-p},
2910@code{file-ownership-pre@discretionary{}{}{}served-p}, 2912@code{file-ownership-pre@discretionary{}{}{}served-p},
2911@code{file-readable-p}, @code{file-regular-p}, 2913@code{file-readable-p}, @code{file-regular-p},
2912@code{file-remote-p}, @code{file-selinux-context}, 2914@code{file-remote-p}, @code{file-selinux-context},
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index cb583038979..f5eecb2d569 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -2692,6 +2692,17 @@ Removes an existing file watch specified by its @var{descriptor}.
2692@code{file-notify-add-watch}. 2692@code{file-notify-add-watch}.
2693@end defun 2693@end defun
2694 2694
2695@defun file-notify-valid-p descriptor
2696Checks a watch specified by its @var{descriptor} for validity.
2697@var{descriptor} should be an object returned by
2698@code{file-notify-add-watch}.
2699
2700A watch can become invalid if the file or directory it watches is
2701deleted, or if the watcher thread exits abnormally for any other
2702reason. Removing the watch by calling @code{file-notify-rm-watch}
2703also makes it invalid.
2704@end defun
2705
2695@node Dynamic Libraries 2706@node Dynamic Libraries
2696@section Dynamically Loaded Libraries 2707@section Dynamically Loaded Libraries
2697@cindex dynamic libraries 2708@cindex dynamic libraries