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.
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.)