GNU bug report logs - #267
dired-do-query-replace-regex replace ALL

Previous Next

Package: emacs;

Reported by: xah lee <xah <at> xahlee.org>

Date: Sat, 17 May 2008 10:35:03 UTC

Severity: wishlist

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 267 in the body.
You can then email your comments to 267 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#267; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to xah lee <xah <at> xahlee.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: xah lee <xah <at> xahlee.org>
To: emacs-pretest-bug <at> gnu.org
Subject: dired-do-query-replace-regex replace ALL
Date: Sat, 17 May 2008 03:26:26 -0700
Emacs suggestion:

when in dired mode in the processing of doing dired-do-query-replace- 
regexp (shortcut Q), it offers the ability to do replacement without  
asking on the current file, by pressing the ! key, but it would be  
nice to have:

(1) the ability to do ALL replacements on ALL files without further  
asking.
(2) the ability to not do any replacement on the current file.

I use dired-do-query-replace-regexp few times a week, typically on  
tens of files, but maybe once in a month i do it over hundreds or  
thuosands of files on a website.

Often, after some replacement, it becomes obvious that it is safe to  
do ALL replacement for ALL files. When this is needed, typically i  
can just hold down the ! key. But when the number of files is  
hundreds or more, typically there will be seveal 5 second delays  
where i assume emacs is doing garbage collection. The bottom line is  
that, holding down ! is not a good solution because i end up having  
to wait a total of maybe 20 or 30 seconds during the whole operation.

For this reason, i often abort the operation, then switch to a perl  
or python script i've written that does blind find/replace on all  
files. This will finish the job on thousands of files within 5  
seconds. But I couldn't reply on this since often i need  
interactively see and confirm the replacements, which emacs provides.  
(emacs also lets me view the change file afterwards or decide to save  
them...etc, which i won't be able to do with perl...)

So, it would be nice, if emacs's dired-do-query-replace-regexp offer  
the option to do all replacement on all files.

Perhaps this can be introduced as pressing the @ key.

For suggestion item (2), the scenario is that sometimes i have a big  
file and it is apparent that i don't want any replacement to happen  
on that file. As things are, i have to repeatedly pressing n while  
paying attention not to go over to the next file. This is a tiring  
process.

dired-do-query-replace-regexp is very nice and i've been using it for  
2 years. For just tens of files the above isn't a problem. But when  
doing few hundred files, and on tens of replacement pairs (i.e. using  
dired-do-query-replace-regexp tens of times, each time on hundreds of  
files), the above features seems a very good one to have. It seems  
also a logical feature complementating the various recursive edit and  
edit-replacement-text currently provided by emacs.

PS some background... I'm doing on static websites, which has few  
hundred or thousand files, such as systimatically changing a style  
markup, etc. In the past 2 days, i spent entire 2 days using dired-do- 
query-replace-regexp (in combination with perl and python script).

Thanks.

  Xah
  xah <at> xahlee.org
∑ http://xahlee.org/

Severity set to `wishlist' from `normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 01 Jul 2008 01:05:06 GMT) Full text and rfc822 format available.

Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Thu, 04 Oct 2012 18:39:01 GMT) Full text and rfc822 format available.

Notification sent to xah lee <xah <at> xahlee.org>:
bug acknowledged by developer. (Thu, 04 Oct 2012 18:39:02 GMT) Full text and rfc822 format available.

Message #12 received at 267-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: xah lee <xah <at> xahlee.org>
Cc: 267-done <at> debbugs.gnu.org
Subject: Re: bug#267: dired-do-query-replace-regex replace ALL
Date: Thu, 04 Oct 2012 21:37:40 +0300
> Emacs suggestion:
>
> when in dired mode in the processing of doing dired-do-query-replace-
> regexp (shortcut Q), it offers the ability to do replacement without asking
> on the current file, by pressing the ! key, but it would be nice to have:
>
> (1) the ability to do ALL replacements on ALL files without further asking.
> (2) the ability to not do any replacement on the current file.

According to http://ergoemacs.org/emacs/modernization_find_replace_multi.html
this suggestion is implemented in emacs 23.1, released on 2009-07,
so bug#267 can be closed.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#267; Package emacs. (Sat, 13 Oct 2012 16:14:04 GMT) Full text and rfc822 format available.

Message #15 received at 267 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: 267 <at> debbugs.gnu.org
Subject: Re: bug#267: closed (Re: bug#267: dired-do-query-replace-regex
	replace ALL)
Date: Sat, 13 Oct 2012 19:09:13 +0300
Actually the remaining patch that would finalize this feature request
is to mention it in the help message of `query-replace':

=== modified file 'lisp/replace.el'
--- lisp/replace.el	2012-10-05 21:27:50 +0000
+++ lisp/replace.el	2012-10-13 16:09:04 +0000
@@ -1604,9 +1604,12 @@ (defconst query-replace-help
 C-r to enter recursive edit (\\[exit-recursive-edit] to get out again),
 C-w to delete match and recursive edit,
 C-l to clear the screen, redisplay, and offer same replacement again,
-! to replace all remaining matches with no more questions,
+! to replace all remaining matches in this buffer with no more questions,
 ^ to move point back to previous match,
-E to edit the replacement string"
+E to edit the replacement string.
+In multi-buffer replacements type `Y' to replace all remaining
+matches in all remaining buffers with no more questions,
+`N' to skip to the next buffer."
   "Help message while in `query-replace'.")
 




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 11 Nov 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.