fish-shell/doc_src
Fabian Homborg 340de73172 Call "fish_command_not_found" if a command wasn't found
Previously, when a command wasn't found, fish would emit the
"fish_command_not_found" *event*.

This was annoying as it was hard to override (the code ended up
checking for a function called `__fish_command_not_found_handler`
anyway!), the setup was ugly,
and it's useless - there is no use case for multiple command-not-found handlers.

Instead, let's just call a function `fish_command_not_found` if it
exists, or print the default message otherwise.

The event is completely removed, but because a missing event is not an error
(MEISNAE in C++-speak) this isn't an issue.

Note that, for backwards-compatibility, we still keep the default
handler function around even tho the new one is hard-coded in C++.

Also, if we detect a previous handler, the new handler just calls it.

This way, the backwards-compatible way to install a custom handler is:

```fish
function __fish_command_not_found_handler --on-event fish_command_not_found
    # do a little dance, make a little love, get down tonight
end
```

and the new hotness is

```fish
function fish_command_not_found
    # do the thing
end
```

Fixes #7293.
2020-09-06 11:15:54 +02:00
..
_static docs: use parsed-literal to highlight interactive examples 2020-08-02 14:22:29 -07:00
cmds Call "fish_command_not_found" if a command wasn't found 2020-09-06 11:15:54 +02:00
CHANGELOG.rst Add CHANGELOG to the docs 2020-05-30 10:07:21 +02:00
commands.rst We no longer have two doc systems, move sphinx_doc_src back to doc_src 2020-02-19 17:00:35 -08:00
completions.rst docs: don't quote code snippets 2020-04-13 22:56:22 +02:00
conf.py Add CHANGELOG to the docs 2020-05-30 10:07:21 +02:00
design.rst docs: fix small formatting issues 2020-08-07 22:05:05 +08:00
faq.rst Adjust the FAQ 2020-08-21 20:46:23 +02:00
fish_for_bash_users.rst docs: Add word splitting example 2020-07-09 18:35:41 +02:00
fish_indent_lexer.py We no longer have two doc systems, move sphinx_doc_src back to doc_src 2020-02-19 17:00:35 -08:00
index.rst Fix hybrid binding instructions 2020-08-28 20:50:24 +02:00
license.rst chore: bump copyright year 2019 → 2020 2020-03-14 14:03:09 -07:00
tutorial.rst docs: Fix background color for interactive examples 2020-09-04 19:46:38 +02:00