From 7bf6712498ad2618bee7bf5b3866fb6da0772339 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Thu, 19 Sep 2013 22:27:58 +0200 Subject: All snippets imported, init file polished --- .../text-mode/emacs-lisp-mode/dired.process_marked | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .emacs.d/mysnippets/text-mode/emacs-lisp-mode/dired.process_marked (limited to '.emacs.d/mysnippets/text-mode/emacs-lisp-mode/dired.process_marked') diff --git a/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/dired.process_marked b/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/dired.process_marked new file mode 100644 index 0000000..1b42597 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/dired.process_marked @@ -0,0 +1,16 @@ +#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)) +) + +;; to use it, type M-x dired-myProcessFile -- cgit v1.3