From a7ebc6bf633bd3849ccab032dad6b1fd31b1ef43 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Thu, 11 Oct 2018 17:23:30 +0900 Subject: [PATCH] dired-do-shell-command: Notify users after abort the command * lisp/dired-aux.el (dired-do-shell-command): Notify users that the command have aborted when they answer 'n' to the prompt (Bug#32969). --- lisp/dired-aux.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 516cd2c5672..e40627309d7 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -757,16 +757,17 @@ can be produced by `dired-get-marked-files', for example." (y-or-n-p (format-message "Confirm--do you mean to use `?' as a wildcard? "))) (t)))) - (when ok - (if on-each - (dired-bunch-files (- 10000 (length command)) - (lambda (&rest files) - (dired-run-shell-command - (dired-shell-stuff-it command files t arg))) - nil file-list) - ;; execute the shell command - (dired-run-shell-command - (dired-shell-stuff-it command file-list nil arg))))))) + (cond ((not ok) (message "Command canceled")) + (t + (if on-each + (dired-bunch-files (- 10000 (length command)) + (lambda (&rest files) + (dired-run-shell-command + (dired-shell-stuff-it command files t arg))) + nil file-list) + ;; execute the shell command + (dired-run-shell-command + (dired-shell-stuff-it command file-list nil arg)))))))) ;; Might use {,} for bash or csh: (defvar dired-mark-prefix "" -- 2.39.5