diff options
| author | Michael Albinus | 2015-10-25 14:59:45 +0100 |
|---|---|---|
| committer | Michael Albinus | 2015-10-25 14:59:45 +0100 |
| commit | 80dd76a8e5d08b35c50589fb1ce7ef6a43ee74ab (patch) | |
| tree | 91cd8992511b5864ab068de8320aac8bef5ad173 /doc | |
| parent | ab116b19eda6bf42b11f7b902c749a77d7cb7683 (diff) | |
| download | emacs-80dd76a8e5d08b35c50589fb1ce7ef6a43ee74ab.tar.gz emacs-80dd76a8e5d08b35c50589fb1ce7ef6a43ee74ab.zip | |
Document file notification `stopped' event
* doc/lispref/os.texi (File Notifications): Document `stopped event'.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/os.texi | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 1925bd544e5..0160de82086 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -2632,6 +2632,8 @@ reports attribute changes as well | |||
| 2632 | @var{file} has been renamed to @var{file1} | 2632 | @var{file} has been renamed to @var{file1} |
| 2633 | @item attribute-changed | 2633 | @item attribute-changed |
| 2634 | a @var{file} attribute was changed | 2634 | a @var{file} attribute was changed |
| 2635 | @item stopped | ||
| 2636 | watching @var{file} has been stopped | ||
| 2635 | @end table | 2637 | @end table |
| 2636 | 2638 | ||
| 2637 | Note that the @file{w32notify} library does not report | 2639 | Note that the @file{w32notify} library does not report |
| @@ -2639,6 +2641,11 @@ Note that the @file{w32notify} library does not report | |||
| 2639 | permissions or modification time, has changed, this library reports a | 2641 | permissions or modification time, has changed, this library reports a |
| 2640 | @code{changed} event. | 2642 | @code{changed} event. |
| 2641 | 2643 | ||
| 2644 | The @code{stopped} event reports, that watching the file has been | ||
| 2645 | stopped. This could be because @code{file-notify-rm-watch} was called | ||
| 2646 | (see below), or because the file being watched was deleted, or due to | ||
| 2647 | another error reported from the underlying library. | ||
| 2648 | |||
| 2642 | @var{file} and @var{file1} are the name of the file(s) whose event is | 2649 | @var{file} and @var{file1} are the name of the file(s) whose event is |
| 2643 | being reported. For example: | 2650 | being reported. For example: |
| 2644 | 2651 | ||
| @@ -2708,6 +2715,36 @@ A watch can become invalid if the file or directory it watches is | |||
| 2708 | deleted, or if the watcher thread exits abnormally for any other | 2715 | deleted, or if the watcher thread exits abnormally for any other |
| 2709 | reason. Removing the watch by calling @code{file-notify-rm-watch} | 2716 | reason. Removing the watch by calling @code{file-notify-rm-watch} |
| 2710 | also makes it invalid. | 2717 | also makes it invalid. |
| 2718 | |||
| 2719 | @example | ||
| 2720 | @group | ||
| 2721 | (setq desc (file-notify-add-watch | ||
| 2722 | "/tmp/foo" '(change) 'my-notify-callback)) | ||
| 2723 | @result{} 35025468 | ||
| 2724 | @end group | ||
| 2725 | |||
| 2726 | @group | ||
| 2727 | (write-region "foo" nil "/tmp/foo") | ||
| 2728 | @result{} Event (35025468 created "/tmp/foo") | ||
| 2729 | Event (35025468 changed "/tmp/foo") | ||
| 2730 | @end group | ||
| 2731 | |||
| 2732 | @group | ||
| 2733 | (file-notify-valid-p desc) | ||
| 2734 | @result{} t | ||
| 2735 | @end group | ||
| 2736 | |||
| 2737 | @group | ||
| 2738 | (delete-file "/tmp/foo") | ||
| 2739 | @result{} Event (35025468 deleted "/tmp/foo") | ||
| 2740 | Event (35025468 stopped "/tmp/foo") | ||
| 2741 | @end group | ||
| 2742 | |||
| 2743 | @group | ||
| 2744 | (file-notify-valid-p desc) | ||
| 2745 | @result{} nil | ||
| 2746 | @end group | ||
| 2747 | @end example | ||
| 2711 | @end defun | 2748 | @end defun |
| 2712 | 2749 | ||
| 2713 | @node Dynamic Libraries | 2750 | @node Dynamic Libraries |