all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: xah lee <xah@xahlee.org>
To: emacs-pretest-bug@gnu.org
Subject: dired-do-query-replace-regex replace ALL
Date: Sat, 17 May 2008 03:26:26 -0700	[thread overview]
Message-ID: <DB4DDF05-8749-40D9-8E34-A700816EF823@xahlee.org> (raw)


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@xahlee.org
∑ http://xahlee.org/

             reply	other threads:[~2008-05-17 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-17 10:26 xah lee [this message]
2012-10-04 18:37 ` bug#267: dired-do-query-replace-regex replace ALL Juri Linkov
     [not found] ` <handler.267.D267.134937589428893.notifdone@debbugs.gnu.org>
2012-10-13 16:09   ` bug#267: closed (Re: bug#267: dired-do-query-replace-regex replace ALL) Juri Linkov

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=DB4DDF05-8749-40D9-8E34-A700816EF823@xahlee.org \
    --to=xah@xahlee.org \
    --cc=emacs-pretest-bug@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.