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
..
2020-02-23 21:36:55 +08:00
2020-08-07 21:06:16 +02:00
2020-04-04 10:44:53 +02:00
2020-04-13 22:56:22 +02:00
2020-03-21 15:31:25 +01:00
2020-04-04 10:44:53 +02:00
2020-04-04 10:44:53 +02:00
2020-06-20 18:17:11 +02:00
2020-05-19 21:07:33 +02:00
2020-04-04 10:44:53 +02:00
2020-03-21 15:31:25 +01:00
2020-08-26 17:48:58 +02:00
2020-04-04 10:44:53 +02:00
2020-04-04 10:44:53 +02:00
2020-04-26 17:55:17 +02:00
2020-04-13 22:56:22 +02:00
2020-06-07 19:33:27 +02:00
2020-03-22 15:53:09 +01:00
2020-03-21 15:31:25 +01:00