diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 564c6931b5..20b056e9f1 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -134,27 +134,25 @@ dired--no-subst-explain substituted, and will be passed through normally to the shell. %s + +(Press ^ to %s markers below these occurrences.) " "`" (string (aref command (car char-positions))) - (dired--highlight-no-subst-chars char-positions command mark-positions))))) + (dired--highlight-no-subst-chars char-positions command mark-positions) + (if mark-positions "remove" "add"))))) (defun dired--no-subst-ask (char nb-occur details) - (let ((hilit-char (propertize (string char) 'face 'warning))) - (car - (read-multiple-choice - (format-message - (ngettext - "%d occurrence of `%s' will not be substituted. Proceed?" - "%d occurrences of `%s' will not be substituted. Proceed?" - nb-occur) - nb-occur hilit-char) - `((?y "yes" "Send shell command without substituting.") - (?n "no" "Abort.") - (?d "toggle details" ,(format-message - "Show/hide occurrences of `%s'." hilit-char)) - ,@(when details - '((?m "toggle markers" "Show/hide `^' markers.")))))))) + (let ((hilit-char (propertize (string char) 'face 'warning)) + (choices `(?y ?n ?? ,@(when details '(?^))))) + (read-char-from-minibuffer + (format-message + (ngettext + "%d occurrence of `%s' will not be substituted. Proceed? (%s) " + "%d occurrences of `%s' will not be substituted. Proceed? (%s) " + nb-occur) + nb-occur hilit-char (mapconcat #'string choices ", ")) + choices))) (defun dired--no-subst-confirm (char-positions command) (let ((help-buf (get-buffer-create "*Dired help*")) @@ -174,7 +172,7 @@ dired--no-subst-confirm (?n (setq done t proceed nil)) - (?d + (?? (if details (progn (quit-window nil details) @@ -182,7 +180,7 @@ dired--no-subst-confirm (dired--no-subst-explain help-buf char-positions command markers) (setq details (display-buffer help-buf)))) - (?m + (?^ (setq markers (not markers)) (dired--no-subst-explain help-buf char-positions command markers))))) diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index e1d9eefbea..64a8a035da 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -28,7 +28,7 @@ dired-test-bug27496 (let* ((foo (make-temp-file "foo")) (files (list foo))) (unwind-protect - (cl-letf (((symbol-function 'read-multiple-choice) 'error)) + (cl-letf (((symbol-function 'read-char-from-minibuffer) 'error)) (dired temporary-file-directory) (dired-goto-file foo) ;; `dired-do-shell-command' returns nil on success.