12

Dired lets me mark files and pass their names as arguments to arbitrary shell commands. I would like a way to supply the marked names as arguments to Emacs Lisp functions, either built-in or those I write myself.

Drew
  • 77,472
  • 10
  • 114
  • 243
Low Powah
  • 317
  • 1
  • 9

1 Answers1

13

Just use function dired-get-marked-files. It gives you a list of the marked file and directory names. And then just use funcall or apply to pass them to a function.

(You can also use w in Dired to copy the marked names, separated by spaces, to a (single) string on the kill-ring, which you can then yank to insert them as a group wherever you want.)

Drew
  • 77,472
  • 10
  • 114
  • 243