Subject: Re: bug#74287: [PATCH] Rework history Isearch for Eshell

From: Pengji Zhang <[email-masked]>
Date: Tue, 12 Nov 2024 16:54:27 +0800

James Thomas <[email-masked]> writes:

> Just wanna add a POC to the alternatives suggested. WDYT? Does not use
> regexps for now, and C-. and C-, for cycling (rather than C-r and C-s):
>
> (setq icomplete-in-buffer t)
> (icomplete-mode 1)
>
> (defun my/eshell-history-complete nil
>   (interactive)
>   (let ((icomplete-compute-delay 0)
> 	(completion-at-point-functions
> 	 '((lambda nil
> 	     `(,eshell-last-output-end ,(point) ,(append (cddr eshell-history-ring) nil) . nil)))))
>     (completion-at-point)))
>
> (define-key eshell-hist-mode-map (kbd "M-r") #'my/eshell-history-complete)

Thanks! While I like the simplicity of your approach, I am not sure if
it is a good idea to depend on 'icomplete-mode'. People may have
different preferences for the in-buffer completion framework.