diff options
Diffstat (limited to 'doc_src')
-rw-r--r-- | doc_src/emit.txt | 23 | ||||
-rw-r--r-- | doc_src/index.hdr.in | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/doc_src/emit.txt b/doc_src/emit.txt new file mode 100644 index 00000000..23143999 --- /dev/null +++ b/doc_src/emit.txt @@ -0,0 +1,23 @@ +\section emit emit - Emit a generic event + +\subsection block-synopsis Synopsis + <tt>emit EVENT_NAME</tt> + +\subsection emit-description Description + +The emit builtin fires a generic fish event. Such events can be caught by special functions called event handlers. + +\subsection emit-example Example + +The following code first defines an event handler for the generig +event named 'test_event', and then emits an event of that type. + +<pre> +function event_test --on-event test_event + echo event test!!! +end + +emit test_event + +</pre> + diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index 215f3e80..07e1bdc1 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -1264,6 +1264,7 @@ specific event takes place. Events that can trigger a handler currently are: - When a signal is delivered - When a process or job exits - When the value of a variable is updated +- When the prompt is about to be shown Example: |