From unknown Fri Jun 13 10:34:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6823: 24.0.50; Wdired or Dired enhancement Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Aug 2010 17:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6823@debbugs.gnu.org X-Debbugs-Original-To: Received: via spool by submit@debbugs.gnu.org id=B.128128768410750 (code B ref -1); Sun, 08 Aug 2010 17:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Aug 2010 17:14:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oi9SN-0002nK-9y for submit@debbugs.gnu.org; Sun, 08 Aug 2010 13:14:43 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oi9SL-0002nB-GI for submit@debbugs.gnu.org; Sun, 08 Aug 2010 13:14:42 -0400 Received: from lists.gnu.org ([199.232.76.165]:53543) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Oi9T2-0000gq-Kq for submit@debbugs.gnu.org; Sun, 08 Aug 2010 13:15:24 -0400 Received: from [140.186.70.92] (port=51246 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oi9Ss-0002FJ-Sv for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2010 13:15:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OhoHk-0002x8-Bn for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2010 14:38:21 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:23060) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhoHk-0002uN-1j for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2010 14:38:20 -0400 Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o77IcH2s029650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 7 Aug 2010 18:38:18 GMT Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o77IcG15012338 for ; Sat, 7 Aug 2010 18:38:16 GMT Received: from abhmt001.oracle.com by acsmt355.oracle.com with ESMTP id 495230911281206260; Sat, 07 Aug 2010 11:37:40 -0700 Received: from dradamslap1 (/10.159.221.167) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 07 Aug 2010 11:37:40 -0700 From: "Drew Adams" Date: Sat, 7 Aug 2010 11:37:43 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acs2X58BjaTzFeCvTWOUGELA7om2IQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) Emacs sorely needs one or more commands that let you rename the marked files as a sequence (following a pattern). See MS Windows for an example (but we could do better): 1. You sort the file list the way you want, to put the files you want to act on in the right order. Especially with libraries such as Francis Wright's `dired-sort-menu.el', you can sort Dired in many different ways. 2. You mark the files you want to rename. (In Windows you select them.) 3. You invoke a rename command, and enter a pattern for the new names. The pattern includes an optional starting index, which is a whole number. In Windows you put the index in parens, which are included in the file names. Example: `new name (100)'. The marked files are named `new name (100)', `new name (101)'... Obviously, in Emacs we could provide for better patterns and substitutions than this. But AFAIK today we offer nothing like this. If you have 1000 family photo files you want to rename to something like `2010 Summer Vacation (1000)', `2010 Summer Vacation (1001)' etc. (or even just `1000', `1001'...), then AFAIK the best you can do now is to use Wdired and perform query-replace with some fancy replacement expression. We should offer something simpler for the common task of renaming a sequence of files. In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2010-08-02 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.4) --no-opt --cflags -Ic:/xpm/include' From unknown Fri Jun 13 10:34:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6823: 24.0.50; Wdired or Dired enhancement Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2010 02:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Drew Adams Cc: 6823@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 6823-submit@debbugs.gnu.org id=B6823.12813227176850 (code B ref 6823); Mon, 09 Aug 2010 02:59:01 +0000 Received: (at 6823) by debbugs.gnu.org; 9 Aug 2010 02:58:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiIZR-0001mR-1a for submit@debbugs.gnu.org; Sun, 08 Aug 2010 22:58:37 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiIZO-0001mM-Cl for 6823@debbugs.gnu.org; Sun, 08 Aug 2010 22:58:35 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0L6V008006S3HT00@a-mtaout21.012.net.il> for 6823@debbugs.gnu.org; Mon, 09 Aug 2010 05:59:14 +0300 (IDT) Received: from HOME-C4E4A596F7 ([77.126.102.143]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L6V007B66YPIBD0@a-mtaout21.012.net.il>; Mon, 09 Aug 2010 05:59:14 +0300 (IDT) Date: Mon, 09 Aug 2010 05:59:15 +0300 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il Message-id: <83y6cgv6d8.fsf@gnu.org> References: X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > From: "Drew Adams" > Date: Sat, 7 Aug 2010 11:37:43 -0700 > Cc: > > Emacs sorely needs one or more commands that let you rename the > marked files as a sequence (following a pattern). Doesn't the "% R" command in Dired use query-replace under the hood? If so, doesn't it already allow to include Lisp expressions in the replacement that are eval'ed? From unknown Fri Jun 13 10:34:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6823: 24.0.50; Wdired or Dired enhancement In-Reply-To: Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2010 05:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.128133316211023 (code B ref -1); Mon, 09 Aug 2010 05:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Aug 2010 05:52:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiLHu-0002rk-DZ for submit@debbugs.gnu.org; Mon, 09 Aug 2010 01:52:42 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiLHr-0002rf-UL for submit@debbugs.gnu.org; Mon, 09 Aug 2010 01:52:40 -0400 Received: from lists.gnu.org ([199.232.76.165]:38715) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OiLIW-00021Z-F2 for submit@debbugs.gnu.org; Mon, 09 Aug 2010 01:53:20 -0400 Received: from [140.186.70.92] (port=36756 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiLIV-0001A7-1y for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 01:53:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiLIT-0008IF-J5 for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 01:53:18 -0400 Received: from lo.gmane.org ([80.91.229.12]:41422) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiLIT-0008He-9U for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 01:53:17 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OiLIP-000229-Lr for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 07:53:13 +0200 Received: from 173.77.197-77.rev.gaoland.net ([77.197.77.173]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Aug 2010 07:53:13 +0200 Received: from thierry.volpiatto by 173.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Aug 2010 07:53:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ From: Thierry Volpiatto Date: Mon, 09 Aug 2010 07:50:31 +0200 Organization: ThierryVolpiatto Lines: 69 Message-ID: <87pqxs5o7s.fsf@tux.homenetwork> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 173.77.197-77.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:11gQiYPvHiPdMYzoeCrPrpu7uSg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.3 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) Hi Drew, "Drew Adams" writes: > Emacs sorely needs one or more commands that let you rename the > marked files as a sequence (following a pattern). > > See MS Windows for an example (but we could do better): > > 1. You sort the file list the way you want, to put the files you want to > act on in the right order. Especially with libraries such as Francis > Wright's `dired-sort-menu.el', you can sort Dired in many different > ways. > > 2. You mark the files you want to rename. (In Windows you select them.) > > 3. You invoke a rename command, and enter a pattern for the new names. > The pattern includes an optional starting index, which is a whole > number. In Windows you put the index in parens, which are included in > the file names. Example: `new name (100)'. The marked files are named > `new name (100)', `new name (101)'... > > Obviously, in Emacs we could provide for better patterns and > substitutions than this. But AFAIK today we offer nothing like this. > > If you have 1000 family photo files you want to rename to something like > `2010 Summer Vacation (1000)', `2010 Summer Vacation (1001)' etc. (or > even just `1000', `1001'...), then AFAIK the best you can do now is to > use Wdired and perform query-replace with some fancy replacement > expression. We should offer something simpler for the common task of > renaming a sequence of files. We have have two tools to achieve this, wdired-change-to-wdired-mode, and query-replace-regexp used with \, and \# in the replacement regexp. ,---- | E.g: (in dired) | C-x C-q | C-M-% | ==> [A-Za-z0-9]*.jpg | ==> 2010-summer-vaccation-\,(format "1%03d" \#).jpg `---- You can use also this function:(You may have to run it two times in some rare cases) ,---- | (defun serial-rename (dir ext name start) | "rename all the files of DIR matching regex EXT with the name NAME \ | starting to number START - ex: file01.jpg" | (interactive "Ddir: \nsExt(no dot): \nsName: \nnStart: ") | (find-file dir) | (let* ((ls-dir (file-expand-wildcards (format "*.%s" ext) t)) | (new-ls-dir (loop with len = (length ls-dir) | repeat len for count from start | for fnum = (if (< start 10) "0%s" "%s") | collect (concat dir name (format fnum count) "." ext)))) | (loop for i in ls-dir for index from 0 | for new-name = (nth index new-ls-dir) | unless (file-exists-p new-name) do (rename-file i new-name))) | (revert-buffer nil t nil)) `---- -- Thierry Volpiatto Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From unknown Fri Jun 13 10:34:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6823: 24.0.50; Wdired or Dired enhancement In-Reply-To: Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2010 06:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.128133421311505 (code B ref -1); Mon, 09 Aug 2010 06:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Aug 2010 06:10:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiLYq-0002zW-TK for submit@debbugs.gnu.org; Mon, 09 Aug 2010 02:10:13 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiLYo-0002zP-SP for submit@debbugs.gnu.org; Mon, 09 Aug 2010 02:10:11 -0400 Received: from lists.gnu.org ([199.232.76.165]:44726) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OiLZT-00025u-Jt for submit@debbugs.gnu.org; Mon, 09 Aug 2010 02:10:51 -0400 Received: from [140.186.70.92] (port=49738 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiLZS-00037C-2e for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 02:10:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiLZQ-00025e-Rc for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 02:10:49 -0400 Received: from lo.gmane.org ([80.91.229.12]:56885) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiLZQ-00025Z-MB for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 02:10:48 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OiLZP-0006IP-8v for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 08:10:47 +0200 Received: from 173.77.197-77.rev.gaoland.net ([77.197.77.173]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Aug 2010 08:10:47 +0200 Received: from thierry.volpiatto by 173.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Aug 2010 08:10:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ From: Thierry Volpiatto Date: Mon, 09 Aug 2010 08:08:10 +0200 Organization: ThierryVolpiatto Lines: 25 Message-ID: <87lj8g5ned.fsf@tux.homenetwork> References: <83y6cgv6d8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 173.77.197-77.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:3vwz6jWy34W/Be+a3p9mt/UcGQA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.3 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) Eli Zaretskii writes: >> From: "Drew Adams" >> Date: Sat, 7 Aug 2010 11:37:43 -0700 >> Cc: >> >> Emacs sorely needs one or more commands that let you rename the >> marked files as a sequence (following a pattern). > > Doesn't the "% R" command in Dired use query-replace under the hood? > If so, doesn't it already allow to include Lisp expressions in the > replacement that are eval'ed? It seem "%R" rename only files matching regexp to newname but doesn't allow the use of "\," and "\#" in the regexp replacement like query-replace-regexp does. > > > -- Thierry Volpiatto Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From unknown Fri Jun 13 10:34:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6823: 24.0.50; Wdired or Dired enhancement Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2010 14:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "'Eli Zaretskii'" Cc: 6823@debbugs.gnu.org Received: via spool by 6823-submit@debbugs.gnu.org id=B6823.128136258927517 (code B ref 6823); Mon, 09 Aug 2010 14:04:01 +0000 Received: (at 6823) by debbugs.gnu.org; 9 Aug 2010 14:03:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiSwW-00079m-Hq for submit@debbugs.gnu.org; Mon, 09 Aug 2010 10:03:08 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiSwU-00079P-Is for 6823@debbugs.gnu.org; Mon, 09 Aug 2010 10:03:06 -0400 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o79E3itJ022154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Aug 2010 14:03:46 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o796QHsF003834; Mon, 9 Aug 2010 14:03:44 GMT Received: from abhmt002.oracle.com by acsmt354.oracle.com with ESMTP id 499012561281362555; Mon, 09 Aug 2010 07:02:35 -0700 Received: from dradamslap1 (/10.159.243.183) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Aug 2010 07:02:33 -0700 From: "Drew Adams" References: <83y6cgv6d8.fsf@gnu.org> Date: Mon, 9 Aug 2010 07:02:30 -0700 Message-ID: <61BEBFF918EF4FB699D6D68F76DB49DC@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acs3btr6Yx5geVWyTkSeprPgDH4dYgAW6O3A In-Reply-To: <83y6cgv6d8.fsf@gnu.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Spam-Score: -6.3 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > > Emacs sorely needs one or more commands that let you rename the > > marked files as a sequence (following a pattern). > > Doesn't the "% R" command in Dired use query-replace under the hood? > If so, doesn't it already allow to include Lisp expressions in the > replacement that are eval'ed? That kind of thing is what I had in mind when I said (though I mentioned Wdired, not Dired): >> AFAIK the best you can do now is to use Wdired and perform >> query-replace with some fancy replacement expression The Windows behavior does not require any use of a fancy replacement expression (Lisp). Again, we can do better than Windows does, and it is good to also offer fancy replacement (e.g. Lisp sexps). But we should also offer something as simple as Windows does, and not _require_ users who want to do this kind of common renaming to work their way through Lisp replacement sexps (no matter how simple the sexp might be). In addition, we should probably advertise this renaming better (even %R in Dired), in the Dired/Wdired doc. If %R is the best we can do for now, then perhaps add a very simple, short example to illustrate the kind of renaming I mentioned. From unknown Fri Jun 13 10:34:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6823: 24.0.50; Wdired or Dired enhancement Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2010 14:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "'Thierry Volpiatto'" , Received: via spool by submit@debbugs.gnu.org id=B.128136333727883 (code B ref -1); Mon, 09 Aug 2010 14:16:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Aug 2010 14:15:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiT8b-0007Fg-91 for submit@debbugs.gnu.org; Mon, 09 Aug 2010 10:15:37 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiT8a-0007Fa-Ld for submit@debbugs.gnu.org; Mon, 09 Aug 2010 10:15:37 -0400 Received: from lists.gnu.org ([199.232.76.165]:37871) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OiT9G-0006DT-21 for submit@debbugs.gnu.org; Mon, 09 Aug 2010 10:16:18 -0400 Received: from [140.186.70.92] (port=39259 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiT9E-00076T-Ho for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 10:16:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiT9C-0006cL-4G for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 10:16:16 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:62635) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiT9B-0006bx-UC for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 10:16:14 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o79EG7E1029063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Aug 2010 14:16:09 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o795ADjm017202; Mon, 9 Aug 2010 14:16:06 GMT Received: from abhmt018.oracle.com by acsmt354.oracle.com with ESMTP id 479151421281363365; Mon, 09 Aug 2010 07:16:05 -0700 Received: from dradamslap1 (/10.159.243.183) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Aug 2010 07:16:05 -0700 From: "Drew Adams" References: <87pqxs5o7s.fsf@tux.homenetwork> Date: Mon, 9 Aug 2010 07:16:01 -0700 Message-ID: <2F0E9BE0383248998DD1960E32677585@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acs3iVEMzcHBTgLgTRSymA3rNJ9d2gAQvb9A In-Reply-To: <87pqxs5o7s.fsf@tux.homenetwork> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.3 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > > AFAIK the best you can do now is to use Wdired and perform > > query-replace with some fancy replacement expression. > > We should offer something simpler for the common task of > > renaming a sequence of files. > > We have have two tools to achieve this, wdired-change-to-wdired-mode, > and query-replace-regexp used with \, and \# in the > replacement regexp. That's exactly what I meant by "use Wdired and perform query-replace with some fancy replacement expression." I know that a user can do it. What I suggest is that we also "offer something simpler for the common task of renaming a sequence of files." A Windows user need not be familiar with Lisp sexps (and especially arcane incantations using `\,' and \#). It's great to have that capability, but we should also offer something simpler for the common, simple case. > You can use also this function:(You may have to run it two > times in some rare cases) > > (defun serial-rename (dir ext name start)... I haven't tried it, but from the doc string, it sounds like the kind of thing I had in mind. The doc for Dired should mention such a command (which should be bound to a key), and it should mention that you can do fancier, more flexible replacement using query-replace with `\,', `\#', etc. From unknown Fri Jun 13 10:34:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6823: 24.0.50; Wdired or Dired enhancement Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2010 14:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Drew Adams" Cc: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.128136542928932 (code B ref -1); Mon, 09 Aug 2010 14:51:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Aug 2010 14:50:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiTgL-0007Wb-79 for submit@debbugs.gnu.org; Mon, 09 Aug 2010 10:50:29 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiTgJ-0007WW-05 for submit@debbugs.gnu.org; Mon, 09 Aug 2010 10:50:27 -0400 Received: from lists.gnu.org ([199.232.76.165]:58275) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OiTgy-0006Po-MX for submit@debbugs.gnu.org; Mon, 09 Aug 2010 10:51:08 -0400 Received: from [140.186.70.92] (port=54130 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiTgu-0006sp-9b for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 10:51:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiTgs-0004su-Uf for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 10:51:04 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:41474) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiTgs-0004sg-QW for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 10:51:02 -0400 Received: by wyg36 with SMTP id 36so11262943wyg.0 for ; Mon, 09 Aug 2010 07:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject :organization:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=kEm3kPwAUOIk/z1k60wzIg0LjlAh/z1XR1j0qYVb7ic=; b=NzGBgZwjmzxAo2Bd4f75xdpxJ+y4GVHCd5bTiMEGnPTjS7m/GL36UMb5HpcI132/RO 3zWp7BY8GtF8kezQ8xkq8UmN5solZJ+Z6++nM3e5IAe36R9aiuiTVx74jXPXbcWatL1e bz5KePGmC2YK0gLG3yno/NySOZv5PCuliCo4c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=J9lks4YX5eZxAq6PTrhXDOp31lYGiMCzTDCNhxznZpM/8VSQkowqA3VZMrVDKUkr8O Avo6TveCWoNLURzgWzUnqZ0Sx/HyqAAmHV0I8FKhNg/A9V2tRDCrvRdEq1RSmyieIk8v ikSg4fK6xAHHhH0xTR41mAKL+U9olz+tjZnB4= Received: by 10.227.144.2 with SMTP id x2mr13951053wbu.76.1281365461272; Mon, 09 Aug 2010 07:51:01 -0700 (PDT) Received: from tux.homenetwork (173.77.197-77.rev.gaoland.net [77.197.77.173]) by mx.google.com with ESMTPS id l55sm2612293weq.17.2010.08.09.07.50.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Aug 2010 07:51:00 -0700 (PDT) From: Thierry Volpiatto Organization: ThierryVolpiatto References: <87pqxs5o7s.fsf@tux.homenetwork> <2F0E9BE0383248998DD1960E32677585@us.oracle.com> Date: Mon, 09 Aug 2010 16:48:26 +0200 In-Reply-To: <2F0E9BE0383248998DD1960E32677585@us.oracle.com> (Drew Adams's message of "Mon, 9 Aug 2010 07:16:01 -0700") Message-ID: <87lj8fj0zp.fsf@tux.homenetwork> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.4 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.4 (-----) "Drew Adams" writes: >> > AFAIK the best you can do now is to use Wdired and perform >> > query-replace with some fancy replacement expression. >> > We should offer something simpler for the common task of >> > renaming a sequence of files. >> >> We have have two tools to achieve this, wdired-change-to-wdired-mode, >> and query-replace-regexp used with \, and \# in the >> replacement regexp. > > That's exactly what I meant by "use Wdired and perform query-replace with some > fancy replacement expression." Ah! yes sorry. > I know that a user can do it. What I suggest is that we also "offer something > simpler for the common task of renaming a sequence of files." > > A Windows user need not be familiar with Lisp sexps (and especially arcane > incantations using `\,' and \#). It's great to have that capability, but we > should also offer something simpler for the common, simple case. Maybe have a special command for wdired that start wdired-mode but provide a special regexp template for this case to give to query-replace. What is good with wdired+query-replace is we can undo if regexp is wrong until we find a good regexp. >> You can use also this function:(You may have to run it two >> times in some rare cases) >> >> (defun serial-rename (dir ext name start)... > > I haven't tried it, but from the doc string, it sounds like the kind of thing I > had in mind. > > The doc for Dired should mention such a command (which should be bound to a > key), and it should mention that you can do fancier, more flexible replacement > using query-replace with `\,', `\#', etc. > This command (serial-rename) is not part of emacs, it's just a little command of my config i use sometime to rename quickly my photos. However i prefer wdired/query-replace-regexp. -- Thierry Volpiatto Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997