all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Thorpe <rt@robertthorpeconsulting.com>
To: cplum987@gmail.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: editing previous command in the *shell* buffer
Date: Wed, 29 Apr 2015 01:20:43 +0100	[thread overview]
Message-ID: <877fsvwzs4.fsf@robertthorpeconsulting.com> (raw)
In-Reply-To: <36243f68-c9ad-4185-af20-215cceecf0b3@googlegroups.com> (cplum987@gmail.com)

cplum987@gmail.com writes:

> [BTW, I meant C-r, not C-s. My brain can never recall why my fingers type.]
>
> 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).

There are quite a few other commands available.  See (info "(emacs)
Shell Ring")

> With xemacs, "cd M-p" would have found the most recent occurrence of a
> command that started with "cd", and entered it as the current command
> so I can edit it (it doesn't take you to the location in *shell* of
> the match like C-r does). No need to press <RET> first and hope it
> grabs the right one. Also, each time I type M-p after that, it will
> grab an even older instance of a command that starts with those same
> chars. So I just type the first few chars of the command, and then
> type M-p until xemacs finds the one I want.

This sounds useful.  There's probably a package on Melpa or Marmalade to
do it.  But I don't know precisely where to start looking.

BR,
Robert Thorpe



  parent reply	other threads:[~2015-04-29  0:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 23:06 editing previous command in the *shell* buffer cplum987
2015-04-28 14:18 ` Doug Lewan
2015-04-28 17:10 ` HASM
2015-04-28 19:39   ` cplum987
2015-04-28 21:29     ` Barry Margolin
2015-04-29  0:20     ` Robert Thorpe [this message]
     [not found]     ` <mailman.1854.1430266854.904.help-gnu-emacs@gnu.org>
2015-04-29  4:22       ` cplum987
     [not found] ` <mailman.1792.1430230730.904.help-gnu-emacs@gnu.org>
2015-04-28 19:23   ` cplum987
2015-04-29 11:57 ` Steve Perry
2015-04-29 20:14   ` cplum987

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877fsvwzs4.fsf@robertthorpeconsulting.com \
    --to=rt@robertthorpeconsulting.com \
    --cc=cplum987@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.