Michiel Borkent
Michiel Borkent

Reputation: 34860

Single most useful example of using dired (Emacs)

What is your single most useful example of using dired mode in Emacs? Any nice tricks? Please one example per answer.

Upvotes: 7

Views: 1688

Answers (5)

Chmouel Boudjnah
Chmouel Boudjnah

Reputation: 2559

For me wdired is one of the nicest feature to be used with dired, it allows to do all sorts of emacs editing magic things on a directory to be able to rename the files, see some of the documentation on the emacswiki's page :

http://www.emacswiki.org/emacs/WDired

Upvotes: 10

Uday Reddy
Uday Reddy

Reputation: 5600

On Windows, I bind this function to a key (C-c C-o). Then I need just this one key to open every kind of file (pdf, ps, dvi, jpg, au, wmv,... you name it).

(defun dired-w32-shell-open ()
  "Open file in Win32."
  (interactive)
  (let ((file (w32-convert-filename (dired-get-filename))))
    (w32-shell-execute "open" file)
    ))

Upvotes: 2

phils
phils

Reputation: 73345

I often find it useful to run find-grep-dired to get a list of files in the tree which contain a given patten, and then using t to mark them all in dired (or more selectively if necessary) and Q to run an interactive search and replace on all the marked files (typically for that same pattern, in order to change it everywhere).

Upvotes: 3

justinhj
justinhj

Reputation: 11316

wdired mode is cool for renaming photographs and so on. If you learn how to embed lisp code in your regular expression you can do interesting things with dates and names etc.

M-x dired
(navigate to the folder)
M-x wdired-change-to-wdired-mode
M-x replace-regexp
(enter search and replace expressions)
C-c C-c 

I have a few more tips on dired on my blog.

link text

Upvotes: 6

Noufal Ibrahim
Noufal Ibrahim

Reputation: 72845

I don't know about 'single most' but the gnus-dired.el module has some nifty utilities to quickly add attachments to mails you're composing. I've found it quite useful in the past.

http://www.koders.com/lisp/fidF2236488FD787692D0859F1D23403E205AEFE048.aspx?s=zombie

Here is Sacha Chua's snippet on some useful functions.

Upvotes: 0

Related Questions