Execute command on marked buffers
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
Execute command on marked buffers         


Author: Sean McLaughlin
Date: Sep 8, 2008 09:06

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.
2 Comments
Re: Execute command on marked buffers         


Author: Xah
Date: Sep 8, 2008 13:58

On Sep 8, 9:06 am, "Sean McLaughlin" 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))
)
Show full article (0.86Kb)
no comments
Re: Execute command on marked buffers         


Author: Michael Heerdegen
Date: Sep 9, 2008 02:18

I use `ibuffer' as buffer menu. There, pressing E does what you
want. You can try it with M-x ibuffer.
no comments