Prevent not-yet-loaded functions from loaded when erased (#5951)

* Prevent not-yet-loaded functions from loaded when erased

Today, `functions --erase $function` does nothing if the function
hasn't been autoloaded yet.

E.g. run, in an interactive session

    > functions --erase ls
    > type ls

and be amazed that it still shows our default `ls --color=auto`
wrapper function.

This seems counter-intuitive - removing a function ought to remove it,
whether it had been executed before or not.

* doc/changelog
This commit is contained in:
Fabian Homborg
2019-06-22 11:08:36 +02:00
committed by GitHub
parent fe2ec1e4f8
commit 9b54a53758
3 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,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.
- ``-e`` or ``--erase`` causes the specified functions to be erased. This also means that it is prevented from autoloading.
- ``-D`` or ``--details`` reports the path name where each function is defined or could be autoloaded, ``stdin`` if the function was defined interactively or on the command line or by reading stdin, and ``n/a`` if the function isn't available. If the ``--verbose`` option is also specified then five lines are written: