From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: Completions and history Date: Wed, 13 Apr 2022 10:50:30 +0300 Organization: LINKOV.NET Message-ID: <865yndxvzt.fsf@mail.linkov.net> References: <20220411112901.kv3lsyvx6yxwjbph.ref@Ergus> <20220411112901.kv3lsyvx6yxwjbph@Ergus> <86sfqjzhgl.fsf@mail.linkov.net> <20220411174031.2yuh2je5fl3lej7i@Ergus> <87ilre5i5a.fsf@gmail.com> <86k0burxd4.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36962"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Daniel Mendler , Ergus , Augusto Stoffel , "emacs-devel@gnu.org" To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 13 09:55:36 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neXqh-0009QC-2z for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Apr 2022 09:55:35 +0200 Original-Received: from localhost ([::1]:39398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neXqf-0006Ip-Jq for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Apr 2022 03:55:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neXoP-0005P0-9c for emacs-devel@gnu.org; Wed, 13 Apr 2022 03:53:16 -0400 Original-Received: from relay11.mail.gandi.net ([2001:4b98:dc4:8::231]:35419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neXoJ-0005Th-7n for emacs-devel@gnu.org; Wed, 13 Apr 2022 03:53:12 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id A1AF4100010; Wed, 13 Apr 2022 07:52:54 +0000 (UTC) In-Reply-To: (Drew Adams's message of "Tue, 12 Apr 2022 19:49:52 +0000") Received-SPF: pass client-ip=2001:4b98:dc4:8::231; envelope-from=juri@linkov.net; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288351 Archived-At: --=-=-= Content-Type: text/plain >> Does Icicles support history completion in eshell and comint? > > Yes, I believe so. > > Command `icicle-comint-command': > > Retrieve a previously used command. > Use this in a `comint-mode' buffer such as `*shell*' or > `*inferior-lisp*'. It seems `icicle-comint-command' does the same as `comint-dynamic-list-input-ring' bound to `C-c C-l'. Maybe the same key `C-c C-l' could be bound by default in the minibuffer to enable history completion? BTW, currently this command highlights the header line only partly. Here is a fix to keep text properties by replace-match: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=comint-dynamic-list-input-ring.patch diff --git a/lisp/comint.el b/lisp/comint.el index 56082f622a..88eaf1120e 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1110,7 +1110,8 @@ comint-dynamic-list-input-ring (use-local-map keymap)) (forward-line 3) (while (search-backward "completion" nil 'move) - (replace-match "history reference"))) + (replace-match (apply #'propertize "history reference" + (text-properties-at (point)))))) (sit-for 0) (message "Hit space to flush") (setq comint-dynamic-list-input-ring-window-conf conf) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index f60af482da..a4a04fc4ec 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1895,9 +1980,7 @@ completions-detailed :version "28.1") (defcustom completions-header-format - (propertize "%s possible completions:\n" - 'face 'shadow - :help "Please select a completion") + (propertize "%s possible completions:\n" 'face 'shadow) "Format of completions header. It may contain one %s to show the total count of completions. When nil, no header is shown." --=-=-=--