unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Execute command on marked buffers
Date: Mon, 8 Sep 2008 13:58:19 -0700 (PDT)	[thread overview]
Message-ID: <fce7f352-6fca-40b3-aae3-ee75ed34fe6a@a18g2000pra.googlegroups.com> (raw)
In-Reply-To: op.ug561nsrv0dqj8@pavilion.domain.invalid


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/

  reply	other threads:[~2008-09-08 20:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08 16:06 Execute command on marked buffers Sean McLaughlin
2008-09-08 20:58 ` Xah [this message]
2008-09-09  9:18 ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fce7f352-6fca-40b3-aae3-ee75ed34fe6a@a18g2000pra.googlegroups.com \
    --to=xahlee@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).