tags:

views:

111

answers:

3

I was searching through for a way to copy/delete directory trees... dired seems to have dired-copy-file-recursive (though sans documentation) and a search on 'recursive' also returns:

tramp-handle-dired-recursive-delete-directory is a compiled Lisp
function in `tramp.el'.

(tramp-handle-dired-recursive-delete-directory FILENAME)

Recursively delete the directory given.
This is like `dired-recursive-delete-directory' for Tramp files.

But I can't find dired-recursive-delete-directory anywhere! Anyone know what's going on? Thanks ~

Edit Thanks all for the responses. The computer I have has 23.1 installed (it's in a remote location with no internet so installations/upgrades are a pain) but I did find dired-delete-file has a recursive option that accomplishes this task (had to activate with (require 'dired)). I look forward to upgrading to 23.2 on my personal machine though!

+2  A: 

You might want to have a look at this section of the Emacs Lisp manual. This refers to the latest stable Emacs version(23.2). It's always a good idea to use it (if possible) anyway.

Bozhidar Batsov
+1  A: 

In Emacs 23.2 the following are available (I copy from Emacs 23.2 news)

  • Changes to file-manipulation functions

  • `delete-directory' has an optional parameter RECURSIVE.

  • New function `copy-directory', which copies a directory recursively.

For complete documentation you can check the Emacs Lisp Reference but of course C-h f is always your friend.

cefstat
I've posted this very same link already ;-)
Bozhidar Batsov
+1  A: 

This will let you mark directories for recursive deletion in dired:

(setq dired-recursive-deletes 'top)

Dired will prompt for confirmation.

sanityinc
Thanks, but not for programming?
Stephen