From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: cplum987@gmail.com Newsgroups: gmane.emacs.help Subject: Re: editing previous command in the *shell* buffer Date: Tue, 28 Apr 2015 21:22:33 -0700 (PDT) Message-ID: References: <36243f68-c9ad-4185-af20-215cceecf0b3@googlegroups.com> (cplum987@gmail.com)> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1430281533 12658 80.91.229.3 (29 Apr 2015 04:25:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2015 04:25:33 +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 29 06:25:32 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YnJYk-0004qo-O0 for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 06:25:18 +0200 Original-Received: from localhost ([::1]:36781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnJYj-0007Si-UK for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 00:25:17 -0400 X-Received: by 10.50.134.202 with SMTP id pm10mr11620396igb.2.1430281354224; Tue, 28 Apr 2015 21:22:34 -0700 (PDT) X-Received: by 10.50.138.66 with SMTP id qo2mr408411igb.13.1430281354211; Tue, 28 Apr 2015 21:22:34 -0700 (PDT) Original-Path: usenet.stanford.edu!l13no11443245iga.0!news-out.google.com!kd3ni2977igb.0!nntp.google.com!l13no11443238iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=148.87.19.222; posting-account=rIGGBgoAAAAEMg3u-3XZX2iW8W_yvSoQ Original-NNTP-Posting-Host: 148.87.19.222 User-Agent: G2/1.0 Injection-Date: Wed, 29 Apr 2015 04:22:34 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:211779 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104061 Archived-At: On Tuesday, April 28, 2015 at 5:20:56 PM UTC-7, Robert Thorpe wrote: > > > M-r seems to be a step in the right direction. However, you don't know > > what command line it will grab until after you press . As an > > example, I just tried "M-r cd". It found a command with "CD" in > > the middle of it. I wanted the one that started with "cd". > > It's a regex as Barry Margolin mentioned, that's one way to narrow > things down. Another is to search further. M-r initiates a backwards > regex isearch of history. When you meet a match C-r will continue the > search back to the next match. (Typing M-r again switches from regex > search to normal search). I couldn't get M-r followed by C-r to work as you described. C-r reverts back to searching the previous pattern I searched with C-r, not the pattern I just searched with M-r. However, I did not know that after doing the first M-r search, I could just repeatedly do "M-r " to search for previous occurrences. Still a bit awkward compared to just having to do M-p on xemacs, but at least is another step closer.