From dbcd30820bccc79680ad83f8a09cdc1614027c5a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 21 Aug 2024 14:53:23 -0400 Subject: [PATCH] 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 --- modules/term/eshell/config.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index f8e69ed2b..9cabb61b1 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -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