unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* dired rename backup file too
@ 2011-03-21  0:20 Kevin Ryde
  0 siblings, 0 replies; 9+ messages in thread
From: Kevin Ryde @ 2011-03-21  0:20 UTC (permalink / raw)
  To: help-gnu-emacs

When renaming a file with dired "R" (dired-do-rename), I'd like it to
rename the backup file too.  So foo -> bar and foo~ -> bar~.  Is there 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.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dired rename backup file too
@ 2011-03-21  8:01 martin rudalics
  0 siblings, 0 replies; 9+ messages in thread
From: martin rudalics @ 2011-03-21  8:01 UTC (permalink / raw)
  To: user42, help-gnu-emacs

 > When renaming a file with dired "R" (dired-do-rename), I'd like it to
 > rename the backup file too.  So foo -> bar and foo~ -> bar~.  Is there 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.

I think such an option would make sense for `rename-file' itself.  And
it should handle any kinds of backups Emacs recognizes.

martin



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dired rename backup file too
       [not found] <mailman.4.1300670284.14871.help-gnu-emacs@gnu.org>
@ 2011-03-21 14:51 ` Xah Lee
  2011-03-22 10:50   ` Uday Reddy
  2011-03-27  7:08   ` David Combs
  0 siblings, 2 replies; 9+ messages in thread
From: Xah Lee @ 2011-03-21 14:51 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 20, 5:20 pm, Kevin Ryde <use...@zip.com.au> wrote:
> When renaming a file with dired "R" (dired-do-rename), I'd like it to
> rename the backup file too.  So foo -> bar and foo~ -> bar~.  Is there 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 “rn”).

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dired rename backup file too
  2011-03-21 14:51 ` dired rename backup file too Xah Lee
@ 2011-03-22 10:50   ` Uday Reddy
  2011-03-22 12:40     ` Xah Lee
  2011-03-27  7:09     ` David Combs
  2011-03-27  7:08   ` David Combs
  1 sibling, 2 replies; 9+ messages in thread
From: Uday Reddy @ 2011-03-22 10:50 UTC (permalink / raw)
  To: help-gnu-emacs

On 3/21/2011 2:51 PM, Xah Lee wrote:

> 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 “rn”).

Kinda funny how it took so long for Emacs to discover that directories 
are editable beasts.  Meanwhile, other Operating Systems like Win32 have 
been editing file names for ages.  GNU is *not Unix*.  We forget that to 
our own detriment.

Cheers,
Uday


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dired rename backup file too
  2011-03-22 10:50   ` Uday Reddy
@ 2011-03-22 12:40     ` Xah Lee
  2011-03-22 18:43       ` Uday Reddy
  2011-03-27  7:09     ` David Combs
  1 sibling, 1 reply; 9+ messages in thread
From: Xah Lee @ 2011-03-22 12:40 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 22, 3:50 am, Uday Reddy <uDOTsDOTre...@cs.bham.ac.uk> wrote:
> On 3/21/2011 2:51 PM, Xah Lee wrote:
>
> > 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 rn ).
>
> Kinda funny how it took so long for Emacs to discover that directories
> are editable beasts.  Meanwhile, other Operating Systems like Win32 have
> been editing file names for ages.  GNU is *not Unix*.  We forget that to
> our own detriment.

haha. Are you being sarcastic? ☺

 Dired can edit file names one at a time, just like OS. Wdired lets
you edit names of multiple files at the same time as if it's a text
file. This feature isn't in Windows, Mac, Linux.

 Xah



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dired rename backup file too
  2011-03-22 12:40     ` Xah Lee
@ 2011-03-22 18:43       ` Uday Reddy
  2011-03-27  7:14         ` David Combs
  0 siblings, 1 reply; 9+ messages in thread
From: Uday Reddy @ 2011-03-22 18:43 UTC (permalink / raw)
  To: help-gnu-emacs

On 3/22/2011 12:40 PM, Xah Lee wrote:

> haha. Are you being sarcastic? ☺

No, I was being serious.  I was trying to point out how buying into the 
Unix way of doing things can block us from doing the right things.

>   Dired can edit file names one at a time, just like OS. Wdired lets
> you edit names of multiple files at the same time as if it's a text
> file. This feature isn't in Windows, Mac, Linux.

Dired allowed you to *rename* files, which is not the same as editing 
file names.  Sometimes, I work with some long file names for which 
renaming - the Unix way - isn't the right solution.  People that have 
used DOS, or its predecessors like CP/M, TOPS-20, TOPS-10 etc., know of 
better ways of doing it.

Yes, Wdired is a great advance.  I agree fully!  That is what GNU and 
Emacs are all about: making advances in user interfaces and building the 
right tools for the right problems.

Cheers,
Uday


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dired rename backup file too
  2011-03-21 14:51 ` dired rename backup file too Xah Lee
  2011-03-22 10:50   ` Uday Reddy
@ 2011-03-27  7:08   ` David Combs
  1 sibling, 0 replies; 9+ messages in thread
From: David Combs @ 2011-03-27  7:08 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

In article <252d8155-845e-4eb2-8cef-56b5ba97926f@b13g2000prf.googlegroups.com>,
Xah Lee  <xahlee@gmail.com> wrote:
>On Mar 20, 5:20 pm, Kevin Ryde <use...@zip.com.au> wrote:
>> When renaming a file with dired "R" (dired-do-rename), I'd like it to
>> rename the backup file too.  So foo -> bar and foo~ -> bar~.  Is there 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 “rn”).
>

One problem with (the really cool) wdired is that after you
do your renaming, deleting, etc, you can't do "g" and still
be in a dired (wdired) of that same set of files -- it
has to kill off the wdired and go back to a regular
dired.

David




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dired rename backup file too
  2011-03-22 10:50   ` Uday Reddy
  2011-03-22 12:40     ` Xah Lee
@ 2011-03-27  7:09     ` David Combs
  1 sibling, 0 replies; 9+ messages in thread
From: David Combs @ 2011-03-27  7:09 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]

In article <4d887f1a$0$23751$14726298@news.sunsite.dk>,
Uday Reddy  <uDOTsDOTreddy@cs.bham.ac.uk> wrote:
>On 3/21/2011 2:51 PM, Xah Lee wrote:
>
>> 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 “rn”).
>
>Kinda funny how it took so long for Emacs to discover that directories 
>are editable beasts.  Meanwhile, other Operating Systems like Win32 have 
>been editing file names for ages.  GNU is *not Unix*.  We forget that to 
>our own detriment.
>
>Cheers,
>Uday

Well, thanks!

First I heard of it.   (On pc, I use xp.)

How to do it?

Thanks!

David





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dired rename backup file too
  2011-03-22 18:43       ` Uday Reddy
@ 2011-03-27  7:14         ` David Combs
  0 siblings, 0 replies; 9+ messages in thread
From: David Combs @ 2011-03-27  7:14 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

In article <4d88edf9$0$23762$14726298@news.sunsite.dk>,
Uday Reddy  <uDOTsDOTreddy@cs.bham.ac.uk> wrote:
>On 3/22/2011 12:40 PM, Xah Lee wrote:
>
>> haha. Are you being sarcastic? ☺
>
>No, I was being serious.  I was trying to point out how buying into the 
>Unix way of doing things can block us from doing the right things.
>
>>   Dired can edit file names one at a time, just like OS. Wdired lets
>> you edit names of multiple files at the same time as if it's a text
>> file. This feature isn't in Windows, Mac, Linux.
>
>Dired allowed you to *rename* files, which is not the same as editing 
>file names.  Sometimes, I work with some long file names for which 
>renaming - the Unix way - isn't the right solution.  People that have 
>used DOS, or its predecessors like CP/M, TOPS-20, TOPS-10 etc., know of 
>better ways of doing it.
>
>Yes, Wdired is a great advance.  I agree fully!  That is what GNU and 
>Emacs are all about: making advances in user interfaces and building the 
>right tools for the right problems.
>
>Cheers,
>Uday

I still have no idea what you're talking about.

Editing file names -- you mean like in word, or a Notepad file, in the
middle of a sentence?

Or do you really mean editing a filename, and when done, the
name of the file on disk has really changed?

Heck, I used tops-20 ("twenex") for years, and never heard of
what I think you're talking about.

Please elaborate a bit.

Thanks!

David



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-03-27  7:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.4.1300670284.14871.help-gnu-emacs@gnu.org>
2011-03-21 14:51 ` dired rename backup file too Xah Lee
2011-03-22 10:50   ` Uday Reddy
2011-03-22 12:40     ` Xah Lee
2011-03-22 18:43       ` Uday Reddy
2011-03-27  7:14         ` David Combs
2011-03-27  7:09     ` David Combs
2011-03-27  7:08   ` David Combs
2011-03-21  8:01 martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2011-03-21  0:20 Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).