From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: bash and reverse-search-history Date: Sat, 22 Apr 2006 13:27:26 -0700 Message-ID: References: <20060422192402.GC4759@radix50.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1145737684 25153 80.91.229.2 (22 Apr 2006 20:28:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 22 Apr 2006 20:28:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 22 22:28:01 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FXOhu-0001yP-MB for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Apr 2006 22:27:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FXOht-0004rs-Ty for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Apr 2006 16:27:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FXOhh-0004rm-Sy for help-gnu-emacs@gnu.org; Sat, 22 Apr 2006 16:27:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FXOhg-0004od-3c for help-gnu-emacs@gnu.org; Sat, 22 Apr 2006 16:27:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FXOhf-0004oK-RU for help-gnu-emacs@gnu.org; Sat, 22 Apr 2006 16:27:39 -0400 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1FXOjW-0003s5-PV for help-gnu-emacs@gnu.org; Sat, 22 Apr 2006 16:29:35 -0400 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k3MKRYPS022243; Sat, 22 Apr 2006 14:27:34 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw1-141-144-64-96.vpn.oracle.com [141.144.64.96]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k3MKRXd7023296 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sat, 22 Apr 2006 14:27:33 -0600 Original-To: "Baurzhan Ismagulov" , X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <20060422192402.GC4759@radix50.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34583 Archived-At: Hello Baurzhan, > Icicles lets you search the entire history (your #2), > updating matches as you type (your #1). This looks interesting. I wanted to try it, however I couldn't find out how to invoke it. I downloaded the *.el files mentioned, put them into ~/.elisp/load, and added the following lines to my ~/.emacs: (add-to-list 'load-path (expand-file-name "~/.elisp/load")) (load-library "icicles.el") After you load Icicles you are automatically in Icicle mode, unless `define-minor-mode' is not defined in your version of Emacs, in which case you can put this in your .emacs (it doesn't hurt to do this anyway): (when (fboundp 'icicle-mode) (icicle-mode 99)). Whenever you are in Icicle mode, you will see "Icy" in the mode line minor-mode list. Command `icicle-mode' enters and exits the mode. In Icicle mode, minibuffer completion is enhanced in several ways, including matching minibuffer history items, with incremental update of the list of possible completions. I start emacs, M-x shell RET, and get the shell prompt. I've read some of the wiki pages, but it isn't clear for me how I can use Icicles. The page about history doesn't mention shell at all, only minibuffer completions. Any idea? I haven't used the Emacs shell in years. I guess I was thinking that you were inputting stuff through the minibuffer - sorry to have misled you. Icicles works with any minibuffer input, but I imagine that you won't get many Icicles features out of the box with comint (shell command line) completion, which does not use the minibuffer. I did enhance dabbrev completion (which, like comint completion, does not use the minibuffer) to be able to take advantage of some Icicles features, but I haven't yet done that for comint (shell) completion. Trying shell command completion just now, I notice that about the only thing you get for free is Icicles candidate cycling, which isn't all that helpful here. Comint completion apparently does its own matching, so it can't automatically take advantage of Icicles completion features like regexp matching. And there is no way to use the Icicles minibuffer history enhancements with the (non-minibuffer) shell history. With some Emacs-Lisp programming, you could probably cobble together some of the Icicles functions to get yourself something workable, but I'm sorry that I don't have time to work on this. So I guess the short answer is that you won't get what you want with Icicles, until I get around to tweaking comint completion so that it can use Icicles features. Sorry for the false route. In bash, you can press C-r, and type, e.g., "dpkg". As you type each character, bash shows the most recent command that matches the expression you've typed up to that moment. In emacs, I press M-r, it asks for a regexp, I type "dpkg". Nothing is updated as I type, emacs waits for me to press RET to start searching. I press RET, it finds the last dpkg command, which happens to be the 29th. I see it isn't what I was looking for, and want to repeat the search. I have to press M-r dpkg RET again (this is the "next run" I'd mentioned in the first posting; "modifying" it is about the case you are not satisfied with your initial regexp and want to enter a more specific one instead of the one you typed at first). Or, I can press M-r M-r RET RET, and emacs will search again. But only 32 commands back?! So, what I'm looking for is more or less exactly bash's C-r functionality. Can I perhaps just unbind emacs's C-r for shell buffers, so that the character is passed to bash? The incremental completion update you describe is available in Icicles (which is why I replied to you) for both standard prefix matching and regexp matching, but only for minibuffer completion. Sorry.