diff options
author | David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au> | 2013-05-12 15:56:01 +0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-05-13 01:48:20 -0700 |
commit | 1287b9d82382bf22e16edda67eae755f07397f2e (patch) | |
tree | 811814b029d65ac11a193e616ca4a71d216dbe0c /doc_src/block.txt | |
parent | 91aab03b90a6b583a3c0ecff5b015c6066d34f28 (diff) |
Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
Diffstat (limited to 'doc_src/block.txt')
-rw-r--r-- | doc_src/block.txt | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/doc_src/block.txt b/doc_src/block.txt index 670a39b2..0f4cff38 100644 --- a/doc_src/block.txt +++ b/doc_src/block.txt @@ -5,15 +5,36 @@ \subsection block-description Description -- <tt>-l</tt> or <tt>--local</tt> Release the block at the end of the currently innermost block scope +\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. + +In functions, \c 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. + +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> + +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 \subsection block-example Example <pre> +# Create a function that listens for events +function --on-event foo foo; echo 'foo fired'; end +# Block the delivery of events block -g -\#Do something that should not be interrupted +emit foo +# No output will be produced block -e +# 'foo fired' will now be printed </pre> |