From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: dired rename backup file too Date: Mon, 21 Mar 2011 07:51:18 -0700 (PDT) Organization: http://groups.google.com Message-ID: <252d8155-845e-4eb2-8cef-56b5ba97926f@b13g2000prf.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1300722045 7464 80.91.229.12 (21 Mar 2011 15:40:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Mar 2011 15:40:45 +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 Mar 21 16:40:41 2011 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.69) (envelope-from ) id 1Q1hDk-0007tx-Fk for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Mar 2011 16:40:40 +0100 Original-Received: from localhost ([127.0.0.1]:51932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1hDj-0000bd-Ko for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Mar 2011 11:40:39 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!b13g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 31 Original-NNTP-Posting-Host: 76.126.112.84 Original-X-Trace: posting.google.com 1300719078 22631 127.0.0.1 (21 Mar 2011 14:51:18 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 21 Mar 2011 14:51:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b13g2000prf.googlegroups.com; posting-host=76.126.112.84; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 Safari/534.16, gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:186169 comp.emacs:101316 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:80307 Archived-At: On Mar 20, 5:20=A0pm, Kevin Ryde wrote: > When renaming a file with dired "R" (dired-do-rename), I'd like it to > rename the backup file too. =A0So foo -> bar and foo~ -> bar~. =A0Is ther= e a > secret option or other command to do that? > > I only use the single foo~ backup style, not the numbered backups, if > that makes it easier. not a solution to your question, but these days hardly call R anymore, but use wdired-change-to-wdired-mode. It has a shortcut since emacs 23.1 (Ctrl+x Ctrl+q). (for me, i just aliased it to =93rn=94). this lets you rename current file or any file, and directly in dired (as opposed to the tiny line in minibuffer). When done, just press Ctrl +c Ctrl+c. To cancel the rename, press Ctrl+Esc. this mechanism also replaced my use of rename by regex (% R), because once in the wdired mode, you can just do normal regex replace. if you use wdired, it can solve your problem too, since you can rename by find/replace all files, which will also rename the same named backup files. warning: there was a bug in emacs 22. If you rename a file to the same name (e.g. swap 2 files), it will end up delete one of them. for emacs newbs, i've wrote some tutorial on renaming files here http://xahlee.org/emacs/rename_file_pattern.html Xah