diff options
author | Fabian Homborg <FHomborg@gmail.com> | 2015-09-11 11:31:04 +0200 |
---|---|---|
committer | Fabian Homborg <FHomborg@gmail.com> | 2015-09-11 11:33:04 +0200 |
commit | 2c648c80c83de50620e4c216a59024398f4e152e (patch) | |
tree | 6491c193decbbff0586b49c1b730e2dcdc0380bd | |
parent | b8d9ba993dbb3bccabfcdd10e754b6a5832546d7 (diff) |
docs: Improve autoloading/event documentation
The thing that says "event handlers can't be autoloaded, put it in config.fish". I make good words.
-rw-r--r-- | doc_src/funcsave.txt | 2 | ||||
-rw-r--r-- | doc_src/index.hdr.in | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/doc_src/funcsave.txt b/doc_src/funcsave.txt index d47ae8e7..32b3f4f3 100644 --- a/doc_src/funcsave.txt +++ b/doc_src/funcsave.txt @@ -9,4 +9,4 @@ funcsave FUNCTION_NAME `funcsave` saves the current definition of a function to a file in the fish configuration directory. This function will be automatically loaded by current and future fish sessions. This can be useful if you have interactively created a new function and wish to save it for later use. -Note that event handlers will not be executed before they are loaded. +Note that because fish loads functions on-demand, saved functions will not function as <a href="index.html#event">event handlers</a> until they are run or sourced otherwise. To activate an event handler for every new shell, add the function to your <a href="index.html#initialization">shell initialization file</a> instead of using `funcsave`. diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index 978a9845..b3f0db92 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -251,7 +251,7 @@ The default value for `$fish_function_path` is `~/.config/fish/functions` `/etc/ It is very important that function definition files only contain the definition for the specified function and nothing else. Otherwise, it is possible that autoloading a function files requires that the function already be loaded, which creates a circular dependency. -Autoloading also won't work for <a href=#event>event handlers</a>, since fish cannot know that a function is supposed to be executed when an event occurs when it hasn't yet loaded the function. +Autoloading also won't work for <a href=#event>event handlers</a>, since fish cannot know that a function is supposed to be executed when an event occurs when it hasn't yet loaded the function. See there for details. \subsubsection syntax-conditional Conditional execution of code and flow control @@ -1115,7 +1115,7 @@ function --on-signal WINCH my_signal_handler end \endfish -Please note that event handlers only become active when a function is loaded which means you might need to manually <a href='commands.html#source'>source</a> a function's file instead of relying on <a href=#syntax-function-autoloading>autoloading</a>. +Please note that event handlers only become active when a function is loaded, which means you might need to otherwise <a href='commands.html#source'>source</a> or execute a function instead of relying on <a href=#syntax-function-autoloading>autoloading</a>. One approach is to put it into your <a href="index.html#initialization">initialization file</a>. For more information on how to define new event handlers, see the documentation for the <a href='commands.html#function'>function</a> command. |