From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastien Newsgroups: gmane.emacs.help Subject: Re: Easy way to rename files sequentially? Date: Sun, 25 Nov 2007 23:11:15 +0000 Message-ID: <87ve7p6hv0.fsf@bzg.ath.cx> References: <87ejeexgfy.fsf@celephais.home.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196032306 27470 80.91.229.12 (25 Nov 2007 23:11:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2007 23:11:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 26 00:11:53 2007 Return-path: Envelope-to: geh-help-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 1IwQdj-0002Ss-3I for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Nov 2007 00:11:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwQdT-0004m8-S0 for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 18:11:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IwQdE-0004m1-Nh for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 18:11:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwQdE-0004lp-AP for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 18:11:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwQdE-0004lm-0d for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 18:11:20 -0500 Original-Received: from nf-out-0910.google.com ([64.233.182.191]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IwQdD-00025N-Ui for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 18:11:20 -0500 Original-Received: by nf-out-0910.google.com with SMTP id f5so491022nfh for ; Sun, 25 Nov 2007 15:11:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:subject:in-reply-to:references:user-agent:date:message-id:mime-version:content-type:sender; bh=mWpkytq0jWWwaBoKZKp5z76VAW3cnApslImN6d6YIhk=; b=PLcFzUlIlcwhKjHgyZ/Zs8vH3eS1sTfdxDt0WCNYiev+0ySX1OxF+KME/U7WnNRH8mSIXltY6VAGKw0VIUt0Sh2bRx/pXtVBHPYOVn3SXZZWw2TicY1igQRFpy07x6DrpVk2SjTprFrCDVg/26zVjfX4DKU8rQIVgafCh+SZqpQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=received:from:to:subject:in-reply-to:references:user-agent:date:message-id:mime-version:content-type:sender; b=P024JLgkf5ZIqSGWHb55IvucZkeAhFo+M1hqiPU+xr7UdHrx0KxVW/niBs8lx8Nq4dSmKDIfy+BLuVCapHxMyOXD2VNM1cJLZf0gV7gr7Uck5bDjEuYOPVHL89E8e2wTJw9e60P+n7hZXT9am5jm4l7LEYHGtAzCHZCVyizEUso= Original-Received: by 10.86.90.2 with SMTP id n2mr2021597fgb.1196032278801; Sun, 25 Nov 2007 15:11:18 -0800 (PST) Original-Received: from bzg.ath.cx ( [78.113.180.159]) by mx.google.com with ESMTPS id c24sm1176570ika.2007.11.25.15.11.16 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Nov 2007 15:11:18 -0800 (PST) Original-Received: by bzg.ath.cx (Postfix, from userid 1000) id 9231415792C; Sun, 25 Nov 2007 23:11:15 +0000 (GMT) In-Reply-To: <87ejeexgfy.fsf@celephais.home.net> (cothrige@yahoo.com's message of "Sun, 25 Nov 2007 13:39:45 -0600") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49525 Archived-At: cothrige writes: > I sometimes have a list of files which I would like to rename both in > a group and in sequence. In the past, for very long lists of files > with a number in the name, e.g. "some random audio file ep 01 of > 200.mp3", I would use thunar as it will very easily and automatically > add a sequential number to the front of the names, resulting in > 01-xxx.mp3 and so on. Of course, there are many reasons I would > rather not have to use thunar, and would prefer to be able to do it > from within emacs. I have managed to do this a few times using wdired > and a keyboard macro, and this really isn't too bad. Yes, this isn't that bad at all (considered the number of times I need to renumber files sequentially -- but you might have other needs.) Here is how I do it (for those interested): 0. (wdired-change-to-wdired-mode) [which I bind to C-c C-c] 1. (kmacro-start-macro-or-insert-counter) 2. Put the point where to add the number in the file 3. again to insert the counter value 4. Put the point where to add the number in the next file 5. to save the macro C-e e e e e ... does the job for me. -- Bastien