From e86a84765f4594bc44c3c959a0cb4e22b25f1860 Mon Sep 17 00:00:00 2001 From: David Adam Date: Mon, 3 Jan 2022 23:03:29 +0800 Subject: [PATCH] funcsave: add documentation for feature added in 3a402b19b --- doc_src/cmds/funcsave.rst | 2 ++ doc_src/cmds/functions.rst | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc_src/cmds/funcsave.rst b/doc_src/cmds/funcsave.rst index bc4d70e43..923530999 100644 --- a/doc_src/cmds/funcsave.rst +++ b/doc_src/cmds/funcsave.rst @@ -15,6 +15,8 @@ Description ``funcsave`` saves a function to a file in the fish configuration directory. This function will be :ref:`automatically loaded ` by current and future fish sessions. This can be useful to commit functions created interactively for permanent use. +If you have erased a function using :ref:`functions `'s ``--erase`` option, ``funcsave`` will remove the saved function definition. + Because fish loads functions on-demand, saved functions cannot serve as :ref:`event handlers ` until they are run or otherwise sourced. To activate an event handler for every new shell, add the function to the :ref:`configuration file ` instead of using ``funcsave``. This is often used after :ref:`funced `, which opens the function in ``$EDITOR`` or ``$VISUAL`` and loads it into the current session afterwards. diff --git a/doc_src/cmds/functions.rst b/doc_src/cmds/functions.rst index 5bbdd2c14..0ef93cdf1 100644 --- a/doc_src/cmds/functions.rst +++ b/doc_src/cmds/functions.rst @@ -25,7 +25,7 @@ The following options are available: - ``-d DESCRIPTION`` or ``--description=DESCRIPTION`` changes the description of this function. -- ``-e`` or ``--erase`` causes the specified functions to be erased. This also means that it is prevented from autoloading. +- ``-e`` or ``--erase`` causes the specified functions to be erased. This also means that it is prevented from autoloading in the current session. Use :ref:`funcsave ` to remove the saved copy. - ``-D`` or ``--details`` reports the path name where the specified function is defined or could be autoloaded, ``stdin`` if the function was defined interactively or on the command line or by reading stdin, ``-`` if the function was created via :ref:`source `, and ``n/a`` if the function isn't available. (Functions created via :ref:`alias ` will return ``-``, because ``alias`` uses ``source`` internally.) If the ``--verbose`` option is also specified then five lines are written: