aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/block.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc_src/block.txt')
-rw-r--r--doc_src/block.txt35
1 files changed, 18 insertions, 17 deletions
diff --git a/doc_src/block.txt b/doc_src/block.txt
index 0f4cff38..37b2de0c 100644
--- a/doc_src/block.txt
+++ b/doc_src/block.txt
@@ -1,40 +1,41 @@
\section block block - temporarily block delivery of events
\subsection block-synopsis Synopsis
- <tt>block [OPTIONS...]</tt>
+\fish{synopsis}
+block [OPTIONS...]
+\endfish
\subsection block-description Description
-\c block prevents events triggered by \c fish or the
-<a href="commands.html#emit"><code>emit</code></a> command from
-being delivered and acted upon while the block is in place.
+`block` prevents events triggered by `fish` or the <a href="commands.html#emit">`emit`</a> command from being delivered and acted upon while the block is in place.
-In functions, \c block can be useful while performing work that
-should not be interrupted by the shell.
+In functions, `block` can be useful while performing work that should not be interrupted by the shell.
-The block can be removed. Any events which triggered while the
-block was in place will then be delivered.
+The block can be removed. Any events which triggered while the block was in place will then be delivered.
-Event blocks should not be confused with code blocks, which are created
-with <code>begin</code>, <code>if</code>, <code>while</code> or
-<code>for</code>
+Event blocks should not be confused with code blocks, which are created with `begin`, `if`, `while` or `for`
The following parameters are available:
-- <tt>-l</tt> or <tt>--local</tt> Release the block automatically at the end of the current innermost code block scope
-- <tt>-g</tt> or <tt>--global</tt> Never automatically release the lock
-- <tt>-e</tt> or <tt>--erase</tt> Release global block
+- `-l` or `--local` Release the block automatically at the end of the current innermost code block scope
+
+- `-g` or `--global` Never automatically release the lock
+
+- `-e` or `--erase` Release global block
+
\subsection block-example Example
-<pre>
+\fish
# Create a function that listens for events
function --on-event foo foo; echo 'foo fired'; end
+
# Block the delivery of events
block -g
+
emit foo
# No output will be produced
+
block -e
# 'foo fired' will now be printed
-</pre>
-
+\endfish