fix(eshell): eshell-did-you-mean: sequencep 771 error

Also removes obsolete hack for eshell-did-you-mean (see
xuchunyang/eshell-did-you-mean#2).

Ref: xuchunyang/eshell-did-you-mean#2
This commit is contained in:
Henrik Lissner 2024-08-21 14:53:23 -04:00
parent 122e3732f7
commit dbcd30820b
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -226,13 +226,17 @@ Emacs versions < 29."
(use-package! eshell-did-you-mean
:after esh-mode ; Specifically esh-mode, not eshell
:config
(eshell-did-you-mean-setup)
;; HACK There is a known issue with `eshell-did-you-mean' where it does not
;; work on first invocation, so we invoke it once manually by setting the
;; last command and then calling the output filter.
(setq eshell-last-command-name "catt")
(eshell-did-you-mean-output-filter "catt: command not found"))
:config (eshell-did-you-mean-setup)
;; HACK: `pcomplete-completions' returns a function, but
;; `eshell-did-you-mean--get-all-commands' unconditionally expects it to
;; return a list of strings, causing wrong-type-arg errors in many cases.
;; `all-completions' handles all these cases.
(defadvice! +eshell--fix-eshell-did-you-mean-a (&rest _)
:override #'eshell-did-you-mean--get-all-commands
(unless eshell-did-you-mean--all-commands
(setq eshell-did-you-mean--all-commands
(all-completions "" (pcomplete-completions))))))
(use-package eshell-syntax-highlighting