all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brad Collins <brad@chenla.org>
Subject: Re: dired question
Date: Tue, 19 Oct 2004 05:49:25 +0700	[thread overview]
Message-ID: <wkfz4b4p6y.fsf@chenla.org> (raw)
In-Reply-To: <gvyis999bj8.fsf@norge.freeshell.org> (Stephen Dickey's message of "17 Oct 2004 23:20:59 +0000")

Stephen Dickey <bokonon@norge.freeshell_DOT_TLD> writes:

> I would like to run a command on files marked in a dired buffer in the
> order in which they were marked.  Is there a built in way to do this?
> If not, I was thinking of advising dired-mark and
> dired-get-marked-files to do this.  Does this approach seem
> reasonable?

What about ! which runs the command dired-do-shell-command?

,----[! -- dired-do-shell-command]
| Run a shell command command on the marked files.
| If no files are marked or a specific numeric prefix arg is given,
| the next arg files are used.  Just C-u means the current file.
| The prompt mentions the file(s) or the marker, as appropriate.
| 
| If there is a `*' in command, surrounded by whitespace, this runs
| command just once with the entire file list substituted there.
| 
| If there is no `*', but there is a `?' in command, surrounded by
| whitespace, this runs command on each file individually with the
| file name substituted for `?'.
`----

There was no mention about the order -- but they seem to be passed in
the order they are marked.  For example, I just marked three files
in dired :

* -rw-rw-rw-   1 deerpig  root        21495 05-29 00:27 2003.11.21
* -rw-rw-rw-   1 deerpig  root         6181 05-29 00:29 2003.12.18
* -rw-rw-rw-   1 deerpig  root          987 05-29 00:28 2003.12.21

And then did a word count.

   ! wc -w

and got this result in the minibuffer.

   3665 2003.11.21
   1003 2003.12.18
    143 2003.12.21

The order is the same as they were marked. Is that what you were
looking for?  dired-do-shell-command is very handy indeed, especially
for deleting non-empty directories, changing permissions etc.

b/

-- 
Brad Collins <brad@chenla.org>, Bangkok, Thailand

  parent reply	other threads:[~2004-10-18 22:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-17 23:20 dired question Stephen Dickey
2004-10-18  5:21 ` oliver
2004-10-18  5:39   ` Stephen Dickey
2004-10-18 14:05 ` Stefan Monnier
2004-10-18 18:05   ` Stephen Dickey
2004-10-18 18:58     ` Stefan Monnier
2004-10-18 21:05       ` Stephen Dickey
2004-10-18 21:34         ` Thien-Thi Nguyen
2004-10-18 22:49 ` Brad Collins [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-05-18 21:07 Dired question harven
2008-05-18 22:20 ` Drew Adams
2008-05-19 13:23 ` Xah Lee
2008-05-19 14:05 ` Joel J. Adamson
2008-05-19 19:11 ` harven

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

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

  git send-email \
    --in-reply-to=wkfz4b4p6y.fsf@chenla.org \
    --to=brad@chenla.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.