GNU bug report logs - #74287
[PATCH] Rework history Isearch for Eshell

Previous Next

Package: emacs;

Reported by: Pengji Zhang <me <at> pengjiz.com>

Date: Sun, 10 Nov 2024 01:23:02 UTC

Severity: normal

Tags: patch

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: James Thomas <jimjoe <at> gmx.net>
To: Pengji Zhang <me <at> pengjiz.com>
Cc: 74287 <at> debbugs.gnu.org
Subject: bug#74287: [PATCH] Rework history Isearch for Eshell
Date: Mon, 11 Nov 2024 05:10:06 +0530
Pengji Zhang wrote:

> Hello,
>
> This patch brings a comint-like interface for history Isearch to Eshell.
> To try it, type 'M-r' in Eshell, and search through the input history
> ring incrementally.
>
> Compared to the existing implementation, this patch integrates with
> Isearch properly, like what we do for the minibuffer and comint modes.
>
> There are relevant discussions (thank you all for the feedback!) in the
> mailing list:
>
>     https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00069.html
>
> For Jim's concern, I do not think this implementation closes the door
> for a history completion interface, as shown by Sean and Juri.

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)

--




This bug report was last modified 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.