[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Execute command on marked buffers
From: |
Xah |
Subject: |
Re: Execute command on marked buffers |
Date: |
Mon, 8 Sep 2008 13:58:19 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Sep 8, 9:06 am, "Sean McLaughlin" <non...@domain.invalid> wrote:
> Having marked some buffers in a buffer menu, how do I execute a
> particular command upon them? Specifically, I want to change a
> bunch of buffers that are erroneously in "xml-mode" to
> "nxml-mode".
>
> This is with 22.2.1.
To apply a function to marked files in dired, use “dired-get-marked-
files”, like this:
;; 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))
)
you can read some other idioms here:
http://xahlee.org/emacs/elisp_idioms.html
Xah
∑ http://xahlee.org/
☄