Commit d984dbc1 authored by Gerd Moellmann's avatar Gerd Moellmann

(dired-do-shell-command): Changed documentation.

(dired-shell-stuff-it): A `?' in COMMAND has now the same
meaning as `*'.
parent 32fd7972
1999-12-06 Inge Frick <inge@nada.kth.se>
* dired-aux.el (dired-do-shell-command): Changed documentation.
(dired-shell-stuff-it): A `?' in COMMAND has now the same
meaning as `*'.
1999-12-06 Gerd Moellmann <gerd@gnu.org> 1999-12-06 Gerd Moellmann <gerd@gnu.org>
* simple.el (insert-buffer): Doc fix. * simple.el (insert-buffer): Doc fix.
......
...@@ -319,6 +319,10 @@ Normally the command is run on each file individually. ...@@ -319,6 +319,10 @@ Normally the command is run on each file individually.
However, if there is a `*' in the command then it is run However, if there is a `*' in the command then it is run
just once with the entire file list substituted there. just once with the entire file list substituted there.
If there is no `*', but a `?' in the command then it is still run
on each file individually but with the filename substituted there
instead of att the end of the command.
No automatic redisplay of dired buffers is attempted, as there's no No automatic redisplay of dired buffers is attempted, as there's no
telling what files the command may have changed. Type telling what files the command may have changed. Type
\\[dired-do-redisplay] to redisplay the marked files. \\[dired-do-redisplay] to redisplay the marked files.
...@@ -370,13 +374,17 @@ the list of file names explicitly with the FILE-LIST argument." ...@@ -370,13 +374,17 @@ the list of file names explicitly with the FILE-LIST argument."
;; (coming from interactive P and currently ignored) to decide what to do. ;; (coming from interactive P and currently ignored) to decide what to do.
;; Smart would be a way to access basename or extension of file names. ;; Smart would be a way to access basename or extension of file names.
;; See dired-trns.el for an approach to this. ;; See dired-trns.el for an approach to this.
;; Bug: There is no way to quote a * ;; Bug: There is no way to quote a * or a ?
;; On the other hand, you can never accidentally get a * into your cmd. ;; On the other hand, you can never accidentally get a * or a ? into
;; your cmd.
(let ((stuff-it (let ((stuff-it
(if (string-match "\\*" command) (cond ((string-match "\\*" command)
(function (lambda (x) (function (lambda (x)
(dired-replace-in-string "\\*" x command))) (dired-replace-in-string "\\*" x command))))
(function (lambda (x) (concat command " " x)))))) ((string-match "\\?" command)
(function (lambda (x)
(dired-replace-in-string "\\?" x command))))
(t (function (lambda (x) (concat command " " x)))))))
(if on-each (if on-each
(mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";") (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";")
(let ((fns (mapconcat 'shell-quote-argument (let ((fns (mapconcat 'shell-quote-argument
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment