]> code.delx.au - gnu-emacs-elpa/blob - packages/yasnippet/snippets/emacs-lisp-mode/x-dired.process_marked.yasnippet
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / yasnippet / snippets / emacs-lisp-mode / x-dired.process_marked.yasnippet
1 # contributor: Xah Lee (XahLee.org)
2 # name: process marked files in dired
3 # key: x-dired
4 # --
5 ;; idiom for processing a list of files in dired's marked files
6
7 ;; suppose myProcessFile is your function that takes a file path
8 ;; and do some processing on the file
9
10 (defun dired-myProcessFile ()
11 "apply myProcessFile function to marked files in dired."
12 (interactive)
13 (require 'dired)
14 (mapc 'myProcessFile (dired-get-marked-files))
15 )
16
17 ;; to use it, type M-x dired-myProcessFile