]> git.eshelyaron.com Git - emacs.git/commitdiff
dired-do-shell-command: Notify users after abort the command
authorTino Calancha <tino.calancha@gmail.com>
Thu, 11 Oct 2018 08:23:30 +0000 (17:23 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Thu, 11 Oct 2018 08:23:30 +0000 (17:23 +0900)
* 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

index 516cd2c5672c39de998948ac1cd6b4230cb2ca22..e40627309d759d8a5dacf167502be25dc22818c7 100644 (file)
@@ -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 ""