all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>
Cc: emacs-devel@gnu.org, "Kim F. Storm" <storm@cua.dk>
Subject: Re: Doing search and replace via *grep* buffer
Date: Thu, 15 Feb 2007 20:39:54 +0100	[thread overview]
Message-ID: <85odnvp5v9.fsf@lola.goethe.zz> (raw)
In-Reply-To: <45D46B33.5070605@gmail.com> (Lennart Borgman's message of "Thu\, 15 Feb 2007 15\:16\:19 +0100")

"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:

> Kim F. Storm wrote:
>> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
>>
>>> Looks very interesting, but would it not be possible to use a
>>> prompting similar for other replace commands in Emacs?
>>
>> I don't follow...  Example, please.
>
>
> There are some replace entries in the menus, for example: Edit -
> Replace - Replace Regexp. That entry prompt first for a regexp to
> match (not applicable here) and then for the action to take. I meant
> something similar to the action prompt.
>
> And it would be nice with an entry there in the edit menu when you are
> in the grep buffer.

I find all of this far too contrived.  We don't need a bunch of new
keybindings and stuff.

Instead, if such functionality is desired, one can just make a minor
mode that will make C-x C-s save all changes in the grep buffer to the
respective files (for efficiency reasons, this might imply going
through the undo stack and getting the info about affected files and
lines, or after-modification-hook keeps track of the changes required
to the files in question).

That means that normal search and replace can be used on the buffer.
One just has to make sure that changes to file name and line number in
the buffer are flagged as an error (perhaps it is easiest to make them
read-only already when they are placed into the buffer).

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2007-02-15 19:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-15 12:11 Doing search and replace via *grep* buffer Kim F. Storm
2007-02-15 12:35 ` Lennart Borgman (gmail)
2007-02-15 13:46   ` Kim F. Storm
2007-02-15 14:16     ` Lennart Borgman (gmail)
2007-02-15 19:39       ` David Kastrup [this message]
2007-02-15 16:47     ` Stefan Monnier
2007-02-15 14:04 ` Chris Moore
2007-02-16  8:51   ` David Kastrup
2007-02-15 18:41 ` Andreas Roehler
2007-02-16  7:46 ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2007-10-11 15:17 René Kyllingstad
2007-10-11 16:12 ` Drew Adams
2007-10-12  2:46 ` Richard Stallman

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=85odnvp5v9.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=storm@cua.dk \
    /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.