From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: emulate readline Date: Wed, 06 Apr 2011 21:01:50 +0300 Message-ID: <83bp0juult.fsf@gnu.org> References: NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1302113183 7550 80.91.229.12 (6 Apr 2011 18:06:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Apr 2011 18:06:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 06 20:06:19 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7X7S-0002NJ-GD for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Apr 2011 20:06:18 +0200 Original-Received: from localhost ([127.0.0.1]:56590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7X7R-0002Fm-UP for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Apr 2011 14:06:17 -0400 Original-Received: from [140.186.70.92] (port=51407 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7X6r-00029h-LO for help-gnu-emacs@gnu.org; Wed, 06 Apr 2011 14:05:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7X6i-0007Ji-C8 for help-gnu-emacs@gnu.org; Wed, 06 Apr 2011 14:05:33 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:50893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7X6i-0007J6-27 for help-gnu-emacs@gnu.org; Wed, 06 Apr 2011 14:05:32 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LJ800I00SDRZO00@a-mtaout23.012.net.il> for help-gnu-emacs@gnu.org; Wed, 06 Apr 2011 21:03:55 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.126.47.180]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LJ800JG3SUH0410@a-mtaout23.012.net.il> for help-gnu-emacs@gnu.org; Wed, 06 Apr 2011 21:03:55 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.175 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:80629 Archived-At: > From: fork > Date: Wed, 6 Apr 2011 17:04:26 +0000 (UTC) > > Is there a way to get the behavior of this (super cool) > readline behavior in the minibuffer? > > In my .inputrc I have this: > > "\e[A": history-search-backward > "\e[B": history-search-forward > "\eOA": history-search-backward > "\eOB": history-search-forward > > So in bash I can type "ps", hit the up-arrow, and get the most recent > command that started with these two letters (e.g. "psql -D foobar"). > The next time I hit up-arrow, I get "psql -U fork -D forksdb", etc. > > I would like to type M-x in emacs, then cycle through previous > commands like this. Your wish has been granted! In Emacs, this is invoked with M-s and M-r. That is M-x M-r psql RET will show you a past command that matches "psql".