# HG changeset patch # User Richard M. Stallman # Date 867651238 0 # Node ID 2240a2e37b12c4561c7ba3838d8f571add2d6b1d # Parent 65274adec5a2b98e8f564bc8130ba4210f8f73d4 (dired-do-shell-command): New arg FILE-LIST so that we don't recompute it after the user provides the input. diff -r 65274adec5a2 -r 2240a2e37b12 lisp/dired-aux.el --- a/lisp/dired-aux.el Mon Jun 30 02:26:51 1997 +0000 +++ b/lisp/dired-aux.el Mon Jun 30 06:13:58 1997 +0000 @@ -319,7 +319,7 @@ ;; 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 @@ 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))