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-05-28 17:41:01 +02:00
2019-05-05 12:09:25 +02:00
2019-05-05 12:09:25 +02:00
2019-05-05 12:09:25 +02:00
2020-02-17 14:14:05 +01:00
2019-05-05 12:09:25 +02:00
2019-05-05 12:09:25 +02:00
2020-04-21 21:11:26 +02:00
2020-01-24 19:05:08 +01:00
2018-05-12 13:48:32 +02:00
2020-07-27 17:19:44 +02:00
2017-10-01 01:11:17 -07:00
2016-11-27 21:27:22 -08:00
2020-08-07 21:06:16 +02:00
2016-11-27 21:27:22 -08:00
2016-11-27 21:27:22 -08:00
2020-07-12 14:18:42 -05:00
2019-02-14 10:57:38 +01:00
2020-07-21 16:59:05 +02:00
2020-04-26 14:39:15 +02:00
2017-04-05 15:31:13 -07:00