tags:

views:

187

answers:

2

In dired you can rename files just by editing the directory listing and then saving it.

Is it possible to use use an alternative method for renaming when using dired for renaming? I want to use "svn mv", "bzr mv" or "git mv" instead of just renaming, so that I can register the extra metadata in the source control system.

+1  A: 

I don't think dired provides any hook for that. You may be stuck doing something like

! hg mv ? target
brendan
+3  A: 

Looking at the functions in dired-aux.el, it seems like the built-in rename-file is what is ultimately called by dired-rename-file (which is the fuction bound to 'R' in dired-mode).

What you could do is grab that function and replace the call to rename-file with a call to shell-command that runs the appropriate VCS command.

However, another (better/easier) option would be to use one of Emacs's VCS modes to rename your files in your revision control system directly -- have a look at magit or PSVN or MercurialMode, depending on your choice of poison...

genehack