help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: editing previous command in the *shell* buffer


From: cplum987
Subject: Re: editing previous command in the *shell* buffer
Date: Tue, 28 Apr 2015 21:22:33 -0700 (PDT)
User-agent: G2/1.0

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 <RET>. As an
> > example, I just tried  "M-r cd<RET>". 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 <RET>" 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]