From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Doing search and replace via *grep* buffer Date: Thu, 15 Feb 2007 20:39:54 +0100 Message-ID: <85odnvp5v9.fsf@lola.goethe.zz> References: <45D453A0.6030902@gmail.com> <45D46B33.5070605@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171568438 20049 80.91.229.12 (15 Feb 2007 19:40:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Feb 2007 19:40:38 +0000 (UTC) Cc: emacs-devel@gnu.org, "Kim F. Storm" To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 15 20:40:29 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HHmSq-0002lS-UL for ged-emacs-devel@m.gmane.org; Thu, 15 Feb 2007 20:40:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HHmSq-0003vJ-Em for ged-emacs-devel@m.gmane.org; Thu, 15 Feb 2007 14:40:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HHmSa-0003tv-NP for emacs-devel@gnu.org; Thu, 15 Feb 2007 14:40:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HHmSW-0003tB-FO for emacs-devel@gnu.org; Thu, 15 Feb 2007 14:40:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HHmSV-0003t8-WE for emacs-devel@gnu.org; Thu, 15 Feb 2007 14:40:00 -0500 Original-Received: from mail-in-04.arcor-online.net ([151.189.21.44]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HHmSV-0003TY-F6 for emacs-devel@gnu.org; Thu, 15 Feb 2007 14:39:59 -0500 Original-Received: from mail-in-14-z2.arcor-online.net (mail-in-14-z2.arcor-online.net [151.189.8.31]) by mail-in-04.arcor-online.net (Postfix) with ESMTP id 99C2C17F86E; Thu, 15 Feb 2007 20:39:55 +0100 (CET) Original-Received: from mail-in-09.arcor-online.net (mail-in-09.arcor-online.net [151.189.21.49]) by mail-in-14-z2.arcor-online.net (Postfix) with ESMTP id 8931310110; Thu, 15 Feb 2007 20:39:55 +0100 (CET) Original-Received: from lola.goethe.zz (dslb-084-061-078-240.pools.arcor-ip.net [84.61.78.240]) by mail-in-09.arcor-online.net (Postfix) with ESMTP id 33AD7BBA26; Thu, 15 Feb 2007 20:39:55 +0100 (CET) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 787ED1C460AF; Thu, 15 Feb 2007 20:39:54 +0100 (CET) In-Reply-To: <45D46B33.5070605@gmail.com> (Lennart Borgman's message of "Thu\, 15 Feb 2007 15\:16\:19 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66432 Archived-At: "Lennart Borgman (gmail)" writes: > Kim F. Storm wrote: >> "Lennart Borgman (gmail)" 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