yasnippet-snippets/snippets/emacs-lisp-mode/dired.process_marked

17 lines
478 B
Plaintext
Raw Normal View History

2019-03-09 19:35:58 +01:00
# -*- mode: snippet -*-
2019-03-09 10:42:25 +01:00
# name: process marked files in dired
# contributor : Xah Lee
# --
;; idiom for processing a list of files in dired's marked files
;; suppose myProcessFile is your function that takes a file path
;; and do some processing on the file
(defun dired-myProcessFile ()
"apply myProcessFile function to marked files in dired."
(interactive)
(require 'dired)
(mapc 'myProcessFile (dired-get-marked-files))
)
2019-03-09 19:35:58 +01:00
;; to use it, type M-x dired-myProcessFile