From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: How to rename files to numbers in Eshell? Date: Tue, 14 Sep 2021 11:32:08 +0200 Message-ID: <20210914093208.GC28152@tuxteam.de> References: <87tuirckxp.fsf@inka.de> <87ee9u2neh.fsf@inka.de> <87o88vppqk.fsf@inka.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NKoe5XOeduwbEQHU" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10217"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "Felix E. Klee" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 14 11:34:12 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQ4pP-0002QP-S7 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 14 Sep 2021 11:34:11 +0200 Original-Received: from localhost ([::1]:48582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQ4pO-00011E-NP for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 14 Sep 2021 05:34:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ4nV-00086x-A0 for help-gnu-emacs@gnu.org; Tue, 14 Sep 2021 05:32:14 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:42954) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1mQ4nT-0007Zg-5X for help-gnu-emacs@gnu.org; Tue, 14 Sep 2021 05:32:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:Date; bh=mi/eWSXa6IFr2MGq55cwksjcypPOXqHS8KdPxnYhkDk=; b=ZfZgVQdlJ3dAstbChVBU/8Ju050AFLyJpqGm8YF9fPD4OPss5tyyAUcqvDqlzmdo8TCsL0K8xbe1NMuiRZB6G5AJdmi1H5ca07ZnA1p5Kyor7jULj5fuRE0st5LF2E4Q9WrgoXZTPoTYzXJ9XwjsWF2vZSeR3m+fc0uYjXE26ocutfl2kF5YTI6h2avNzK7JcJqapY4GP6I5pNZIsaRu0NBYVHKkNRyu/um+a7ayZyzGuVvqKBp8sNuxIc8zXOW+4tRLMcYeUYqRq2IJFHfckyAdG9QGLryBUTZwwe6XuhhxAtw02b/M616nFTVsZEIFmh8aIDA80yRDsKVQd912XQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1mQ4nQ-0002hr-Ue; Tue, 14 Sep 2021 11:32:08 +0200 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133039 Archived-At: --NKoe5XOeduwbEQHU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 14, 2021 at 12:17:33PM +0300, Jean Louis wrote: > * Felix E. Klee [2021-09-14 10:43]: > > 3. M-x query-replace-regexp > >=20 > > [^ ]+jpg =E2=86=92 \,(1+ \#).jpg [...] > Thanks for example. >=20 > Though it would be good to have the zero padding for cases when there > are more files than 9 to later easier sort them. Any lisp code can go between the parentheses in \,(...) so you might try \,(format "%03d" \#) (Caveat: I can't test it currently). It's all described in the Emacs Manual "Regexp Replacement" chapter. Cheers - t --NKoe5XOeduwbEQHU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmFAbBgACgkQBcgs9XrR2kbxZwCff7plQ/DATdGtzGHwGdfenmHb 8n8AnR99eH0aC6omzoDK1Tqmslm9vVIY =+Sci -----END PGP SIGNATURE----- --NKoe5XOeduwbEQHU--