aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichael Albinus2016-01-22 19:56:09 +0100
committerMichael Albinus2016-01-22 19:56:09 +0100
commit7bf54d01159eb09bae3c9cd86f2af0812d9afdf6 (patch)
treef00e00ba1ed5a492ec94faf8d07a6ca2f857a9c5 /doc
parentf7dc6d8b5bb318e02a4016d93f8b34de0716f4dc (diff)
downloademacs-7bf54d01159eb09bae3c9cd86f2af0812d9afdf6.tar.gz
emacs-7bf54d01159eb09bae3c9cd86f2af0812d9afdf6.zip
Backport kqueue integration from master
* configure.ac (--with-file-notification): Add kqueue. (top): Remove special test for "${HAVE_NS}" and ${with_file_notification}, this is handled inside gfilenotify tests. Add kqueue tests. Use NOTIFY_CFLAGS and NOTIFY_LIBS instead of library specific variables. Add error message for gfile on Nextstep. * doc/lispref/os.texi (File Notifications): Add kqueue as backend. Fix some glitches in the example. * etc/NEWS: Mention kqueue. * lisp/filenotify.el (file-notify--library) (file-notify-descriptors, file-notify-callback) (file-notify-add-watch, file-notify-rm-watch) (file-notify-valid-p): Add kqueue support. (file-notify--rm-descriptor): Remove WHAT arg. * src/Makefile.in: Use NOTIFY_CFLAGS and NOTIFY_LIBS. * src/emacs.c (main): Call globals_of_kqueue and syms_of_kqueue. * src/inotify.c (inotifyevent_to_event): Extract file name from watch_object if the event doesn't provide it. (Finotify_add_watch): Add file name to watch_object. * src/keyboard.c (make_lispy_event): Check also for HAVE_KQUEUE. * src/kqueue.c: New file. * src/lisp.h: Declare extern globals_of_kqueue and syms_of_kqueue. * test/automated/file-notify-tests.el (file-notify--test-expected-events): Remove. (file-notify--test-cleanup): Do not set that variable. (file-notify--test-timeout) Use different timeouts for different libraries. (file-notify--test-library): New defun. (file-notify--test-event-test): Make stronger checks. (file-notify--test-with-events): EVENTS can also be a list of lists. Flush outstanding events before running the body. Make timeout heuristically depend on the number of events. (file-notify-test01-add-watch, file-notify-test02-events) (file-notify-test04-file-validity, file-notify-test05-dir-validity): Rewrite in order to call file monitors but directory monitors. (file-notify-test02-events, file-notify-test04-file-validity): Do not skip cygwin tests. Add additional test for file creation. Adapt expected result for different backends. (file-notify-test03-autorevert): Some of the tests don't work for w32notify. (file-notify-test06-many-events): New test.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/os.texi41
1 files changed, 22 insertions, 19 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 7206cd4ef86..8e3720eb947 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -2653,9 +2653,9 @@ This function removes the tray notification given by its unique
2653 2653
2654Several operating systems support watching of filesystems for changes 2654Several operating systems support watching of filesystems for changes
2655of files. If configured properly, Emacs links a respective library 2655of files. If configured properly, Emacs links a respective library
2656like @file{gfilenotify}, @file{inotify}, or @file{w32notify} 2656like @file{inotify}, @file{kqueue}, @file{gfilenotify}, or
2657statically. These libraries enable watching of filesystems on the 2657@file{w32notify} statically. These libraries enable watching of
2658local machine. 2658filesystems on the local machine.
2659 2659
2660It is also possible to watch filesystems on remote machines, 2660It is also possible to watch filesystems on remote machines,
2661@pxref{Remote Files,, Remote Files, emacs, The GNU Emacs Manual} 2661@pxref{Remote Files,, Remote Files, emacs, The GNU Emacs Manual}
@@ -2726,7 +2726,8 @@ watching @var{file} has been stopped
2726Note that the @file{w32notify} library does not report 2726Note that the @file{w32notify} library does not report
2727@code{attribute-changed} events. When some file's attribute, like 2727@code{attribute-changed} events. When some file's attribute, like
2728permissions or modification time, has changed, this library reports a 2728permissions or modification time, has changed, this library reports a
2729@code{changed} event. 2729@code{changed} event. Likewise, the @file{kqueue} library does not
2730report reliably file attribute changes when watching a directory.
2730 2731
2731The @code{stopped} event reports, that watching the file has been 2732The @code{stopped} event reports, that watching the file has been
2732stopped. This could be because @code{file-notify-rm-watch} was called 2733stopped. This could be because @code{file-notify-rm-watch} was called
@@ -2765,7 +2766,7 @@ being reported. For example:
2765@group 2766@group
2766(write-region "bla" nil "/tmp/foo") 2767(write-region "bla" nil "/tmp/foo")
2767 @result{} Event (35025468 created "/tmp/.#foo") 2768 @result{} Event (35025468 created "/tmp/.#foo")
2768 Event (35025468 changed "/tmp/foo") [2 times] 2769 Event (35025468 changed "/tmp/foo")
2769 Event (35025468 deleted "/tmp/.#foo") 2770 Event (35025468 deleted "/tmp/.#foo")
2770@end group 2771@end group
2771 2772
@@ -2811,14 +2812,14 @@ also makes it invalid.
2811@example 2812@example
2812@group 2813@group
2813(make-directory "/tmp/foo") 2814(make-directory "/tmp/foo")
2814 @result{} nil 2815 @result{} Event (35025468 created "/tmp/foo")
2815@end group 2816@end group
2816 2817
2817@group 2818@group
2818(setq desc 2819(setq desc
2819 (file-notify-add-watch 2820 (file-notify-add-watch
2820 "/tmp/foo" '(change) 'my-notify-callback)) 2821 "/tmp/foo" '(change) 'my-notify-callback))
2821 @result{} 35025468 2822 @result{} 11359632
2822@end group 2823@end group
2823 2824
2824@group 2825@group
@@ -2828,32 +2829,34 @@ also makes it invalid.
2828 2829
2829@group 2830@group
2830(write-region "bla" nil "/tmp/foo/bla") 2831(write-region "bla" nil "/tmp/foo/bla")
2831 @result{} Event (35025468 created "/tmp/foo/.#bla") 2832 @result{} Event (11359632 created "/tmp/foo/.#bla")
2832 Event (35025468 created "/tmp/foo/bla") 2833 Event (11359632 created "/tmp/foo/bla")
2833 Event (35025468 changed "/tmp/foo/bla") 2834 Event (11359632 changed "/tmp/foo/bla")
2834 Event (35025468 changed "/tmp/foo/.#bla") 2835 Event (11359632 deleted "/tmp/foo/.#bla")
2835@end group 2836@end group
2836 2837
2837@group 2838@group
2838;; Deleting a file in the directory doesn't invalidate the watch. 2839;; Deleting a file in the directory doesn't invalidate the watch.
2839(delete-file "/tmp/foo/bla") 2840(delete-file "/tmp/foo/bla")
2840 @result{} Event (35025468 deleted "/tmp/foo/bla") 2841 @result{} Event (11359632 deleted "/tmp/foo/bla")
2841@end group 2842@end group
2842 2843
2843@group 2844@group
2844(write-region "bla" nil "/tmp/foo/bla") 2845(write-region "bla" nil "/tmp/foo/bla")
2845 @result{} Event (35025468 created "/tmp/foo/.#bla") 2846 @result{} Event (11359632 created "/tmp/foo/.#bla")
2846 Event (35025468 created "/tmp/foo/bla") 2847 Event (11359632 created "/tmp/foo/bla")
2847 Event (35025468 changed "/tmp/foo/bla") 2848 Event (11359632 changed "/tmp/foo/bla")
2848 Event (35025468 changed "/tmp/foo/.#bla") 2849 Event (11359632 deleted "/tmp/foo/.#bla")
2849@end group 2850@end group
2850 2851
2851@group 2852@group
2852;; Deleting the directory invalidates the watch. 2853;; Deleting the directory invalidates the watch.
2854;; Events arrive for different watch descriptors.
2853(delete-directory "/tmp/foo" 'recursive) 2855(delete-directory "/tmp/foo" 'recursive)
2854 @result{} Event (35025468 deleted "/tmp/foo/bla") 2856 @result{} Event (35025468 deleted "/tmp/foo")
2855 Event (35025468 deleted "/tmp/foo") 2857 Event (11359632 deleted "/tmp/foo/bla")
2856 Event (35025468 stopped "/tmp/foo") 2858 Event (11359632 deleted "/tmp/foo")
2859 Event (11359632 stopped "/tmp/foo")
2857@end group 2860@end group
2858 2861
2859@group 2862@group