From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: xah lee Newsgroups: gmane.emacs.bugs Subject: bug#267: dired-do-query-replace-regex replace ALL Date: Sat, 17 May 2008 03:26:26 -0700 Message-ID: Reply-To: xah lee , 267@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753) Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1211043591 30887 80.91.229.12 (17 May 2008 16:59:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 May 2008 16:59:51 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 17 19:00:28 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JxPle-0006tJ-TZ for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 May 2008 19:00:23 +0200 Original-Received: from localhost ([127.0.0.1]:46668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JxPkv-0007DV-CH for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 May 2008 12:59:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JxK0w-0006fn-Kt for bug-gnu-emacs@gnu.org; Sat, 17 May 2008 06:51:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JxK0u-0006fK-2l for bug-gnu-emacs@gnu.org; Sat, 17 May 2008 06:51:45 -0400 Original-Received: from [199.232.76.173] (port=51527 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JxK0t-0006fG-Mu for bug-gnu-emacs@gnu.org; Sat, 17 May 2008 06:51:43 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60217) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JxK0t-0002bo-9V for bug-gnu-emacs@gnu.org; Sat, 17 May 2008 06:51:43 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m4HApesx012804; Sat, 17 May 2008 03:51:41 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m4HAZ30t008157; Sat, 17 May 2008 03:35:03 -0700 X-Loop: don@donarmstrong.com Resent-From: xah lee Original-Sender: emacs-devel-bounces+monnier=iro.umontreal.ca@gnu.org Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 17 May 2008 10:35:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 267 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12110201066867 (code B ref -1); Sat, 17 May 2008 10:35:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 17 May 2008 10:28:26 +0000 Original-Received: from mercure.iro.umontreal.ca (mercure.iro.umontreal.ca [132.204.24.67]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m4HASH9U006861 for ; Sat, 17 May 2008 03:28:19 -0700 Original-Received: by mercure.iro.umontreal.ca (Postfix, from userid 20848) id 89A372CFC89; Sat, 17 May 2008 06:28:17 -0400 (EDT) Original-Received: from pinpin.iro.umontreal.ca (pinpin.iro.umontreal.ca [132.204.24.52]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 6C3E32CFC81 for ; Sat, 17 May 2008 06:28:17 -0400 (EDT) Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by pinpin.iro.umontreal.ca (Postfix) with ESMTP id 623EB3B8B43 for ; Sat, 17 May 2008 06:28:09 -0400 (EDT) Original-Received: from localhost ([127.0.0.1]:58888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JxJe4-0008EU-Qc for monnier@iro.umontreal.ca; Sat, 17 May 2008 06:28:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JxJdV-0008Dg-Um for emacs-devel@gnu.org; Sat, 17 May 2008 06:27:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JxJdU-0008Cq-DC for emacs-devel@gnu.org; Sat, 17 May 2008 06:27:32 -0400 Original-Received: from [199.232.76.173] (port=52587 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JxJdU-0008Ca-6L for emacs-devel@gnu.org; Sat, 17 May 2008 06:27:32 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:57186) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JxJdU-0007Ja-4w for emacs-devel@gnu.org; Sat, 17 May 2008 06:27:32 -0400 Original-Received: from mail.gnu.org ([199.232.76.166]:58086 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JxJcN-0005nA-BF for emacs-pretest-bug@gnu.org; Sat, 17 May 2008 06:26:23 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JxJdP-0007Iz-Ja for emacs-pretest-bug@gnu.org; Sat, 17 May 2008 06:27:31 -0400 Original-Received: from mout.perfora.net ([74.208.4.197]:61307) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JxJdP-0007Gt-2w for emacs-pretest-bug@gnu.org; Sat, 17 May 2008 06:27:27 -0400 Original-Received: from [192.168.1.2] (c-24-6-97-120.hsd1.ca.comcast.net [24.6.97.120]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1JxJdB3QjD-0003QV; Sat, 17 May 2008 06:27:15 -0400 X-Mailer: Apple Mail (2.753) X-Provags-ID: V01U2FsdGVkX1+5/rGXbWO2OIBmbdPFTzSRuvj66DTYfoev9+B HTn3G1gMyOhWk5t6SAapu0ptqh7L34R/lVq0KBKQUzGKlTz1D9 7enGc2PxcTrw5eHO1Jn/A== X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.49, requis 5, BAYES_00 -2.60, MC_REPONSE 0.11, SPF_HELO_PASS -0.00) X-DIRO-MailScanner-From: emacs-devel-bounces+monnier=iro.umontreal.ca@gnu.org X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sat, 17 May 2008 06:51:45 -0400 X-Mailman-Approved-At: Sat, 17 May 2008 12:59:23 -0400 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18034 Archived-At: Emacs suggestion: when in dired mode in the processing of doing dired-do-query-replace-=20 regexp (shortcut Q), it offers the ability to do replacement without =20 asking on the current file, by pressing the ! key, but it would be =20 nice to have: (1) the ability to do ALL replacements on ALL files without further =20 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 =20 tens of files, but maybe once in a month i do it over hundreds or =20 thuosands of files on a website. Often, after some replacement, it becomes obvious that it is safe to =20 do ALL replacement for ALL files. When this is needed, typically i =20 can just hold down the ! key. But when the number of files is =20 hundreds or more, typically there will be seveal 5 second delays =20 where i assume emacs is doing garbage collection. The bottom line is =20 that, holding down ! is not a good solution because i end up having =20 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 =20 or python script i've written that does blind find/replace on all =20 files. This will finish the job on thousands of files within 5 =20 seconds. But I couldn't reply on this since often i need =20 interactively see and confirm the replacements, which emacs provides. =20= (emacs also lets me view the change file afterwards or decide to save =20= 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 =20 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 =20 file and it is apparent that i don't want any replacement to happen =20 on that file. As things are, i have to repeatedly pressing n while =20 paying attention not to go over to the next file. This is a tiring =20 process. dired-do-query-replace-regexp is very nice and i've been using it for =20= 2 years. For just tens of files the above isn't a problem. But when =20 doing few hundred files, and on tens of replacement pairs (i.e. using =20= dired-do-query-replace-regexp tens of times, each time on hundreds of =20= files), the above features seems a very good one to have. It seems =20 also a logical feature complementating the various recursive edit and =20= edit-replacement-text currently provided by emacs. PS some background... I'm doing on static websites, which has few =20 hundred or thousand files, such as systimatically changing a style =20 markup, etc. In the past 2 days, i spent entire 2 days using dired-do-=20= query-replace-regexp (in combination with perl and python script). Thanks. Xah xah@xahlee.org =E2=88=91 http://xahlee.org/ =E2=98=84