summaryrefslogtreecommitdiff
path: root/lisp/dired-aux.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-30 06:13:58 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-30 06:13:58 +0000
commit01db62107e79eb1104ba2b33658a1eb051a6fcb3 (patch)
treed6b4844e16c14f33f894a082aee6dc3dbe53cbd1 /lisp/dired-aux.el
parent0855015c91e69eceb0506159aad2f3ebe491ace6 (diff)
downloademacs-01db62107e79eb1104ba2b33658a1eb051a6fcb3.tar.gz
(dired-do-shell-command): New arg FILE-LIST
so that we don't recompute it after the user provides the input.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r--lisp/dired-aux.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 6c625ea5620..303eed96aed 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -319,7 +319,7 @@ with a prefix argument."
;; The in-background argument is only needed in Emacs 18 where
;; shell-command doesn't understand an appended ampersand `&'.
;;;###autoload
-(defun dired-do-shell-command (command &optional arg)
+(defun dired-do-shell-command (command &optional arg file-list)
"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 \\[universal-argument] means the current file.
@@ -339,16 +339,17 @@ The shell command has the top level directory as working directory, so
output files usually are created there instead of in a subdir."
;;Functions dired-run-shell-command and dired-shell-stuff-it do the
;;actual work and can be redefined for customization.
- (interactive (list
- ;; Want to give feedback whether this file or marked files are used:
- (dired-read-shell-command (concat "! on "
- "%s: ")
- current-prefix-arg
- (dired-get-marked-files
- t current-prefix-arg))
- current-prefix-arg))
- (let* ((on-each (not (string-match "\\*" command)))
- (file-list (dired-get-marked-files t arg)))
+ (interactive
+ (let ((files (dired-get-marked-files t current-prefix-arg)))
+ (list
+ ;; Want to give feedback whether this file or marked files are used:
+ (dired-read-shell-command (concat "! on "
+ "%s: ")
+ current-prefix-arg
+ files)
+ current-prefix-arg
+ files)))
+ (let* ((on-each (not (string-match "\\*" command))))
(if on-each
(dired-bunch-files
(- 10000 (length command))