Currently, the `eshell-atuin--get-input` function uses the
`beginning-of-line` function to move the point to the beginning of the
line (before the prompt). It then checks if the prompt is present
through `looking-at-p` to ensure the current line is a command instead
of output that's scrolled back to.
This works on Emacs 29, but the behaviour of the `beginning-of-line`
function changed in Emacs 30. There, it doesn't actually move the
point before the prompt, but behaves like `eshell-bo`l function (which
is also deprecated on Emacs 30, in favor of using `beginning-of-line`).
To get eshell-atuin to work on Emacs 30, it therefor needs to use
`eshell-bol-ignoring-prompt` instead of `beginning-of-line`.
This patch adds `eshell-atuin--bol-ignoring-prompt`, which calls
`eshell-bol-ignoring-prompt` if available, and falls back to
`beginning-of-line` if it doesn't. This fixes compatibility with Emacs 30.
Currently, eshell-atuin's `eshell-atuin-history` doesn't allow
inserting commands that aren't yet in the history. This patch proposes
unmatched commands are inserted even if they don't match.
Consider the following scenario; you're running eshell-atuin with
`eshell-atuin-history` bound to `C-r`. In Eshell, you type part of a
command, let's say `ls`. Because the command you're looking for should
be in Atuin's database, you press `C-r` and find `ls -l`. That's
helpful, but not the full command you're looking for. You press
`<tab>` to insert the match and add `ah` to get `ls -lah`, the command
you meant to execute. However, after pressing `<ret>`, you find that
eshell-atuin won't let you insert a command that's not in the history
yet.
This patch flips the `REQUIRE-MATCH` boolean in the `completing-read`
call in `eshell-atuin-history` to `nil`, allowing for commands that
aren't in the history yet.
The resulting `compl` variable, which holds the command is then used
to find the command in the history. This is done to make sure any
changes to `eshell-atuin-history-format` don't affect the inserted
command. However, because there is no match in the history in this
scenario, the `command` variable remains empty.
In the end, what's inserted is either the cleaned `command` variable
which mached in the history, or the `compl` variable that didn't
match, and is inserted as-is.