diff options
author | Juri Linkov <[email protected]> | 2009-02-22 23:36:46 +0000 |
---|---|---|
committer | Juri Linkov <[email protected]> | 2009-02-22 23:36:46 +0000 |
commit | c521381a6cb6fc03358a2e2a3a15ddceea0272ec (patch) | |
tree | 19ff2128567f1781b0f2b0fae6db5003a00417b7 /lisp | |
parent | bfb108d0fd6d9ddb408c578a8c3ee90767b4b2c9 (diff) |
(dired-guess-shell-command): Use read-shell-command
instead of read-from-minibuffer.
(dired-read-shell-command): Add code that uses
minibuffer-with-setup-hook to set minibuffer-default-add-function
to minibuffer-default-add-dired-shell-commands exactly like
`dired-read-shell-command' in dired-aux.el already does. Doc fix.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/dired-x.el | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 9570ecda71..4b80ff86ce 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1187,7 +1187,7 @@ See `dired-guess-shell-alist-user'." default-list val) (if (null default) ;; Nothing to guess - (read-from-minibuffer prompt nil nil nil 'dired-shell-command-history) + (read-shell-command prompt nil 'dired-shell-command-history) (if (listp default) ;; More than one guess (setq default-list default @@ -1200,24 +1200,28 @@ See `dired-guess-shell-alist-user'." ;; Put the first guess in the prompt but not in the initial value. (setq prompt (concat prompt (format "[%s] " default))) ;; All guesses can be retrieved with M-n - (setq val (read-from-minibuffer prompt nil nil nil - 'dired-shell-command-history - default-list)) + (setq val (read-shell-command prompt nil + 'dired-shell-command-history + default-list)) ;; If we got a return, then return default. (if (equal val "") default val)))) ;; REDEFINE. ;; Redefine dired-aux.el's version: (defun dired-read-shell-command (prompt arg files) - "Read a dired shell command prompting with PROMPT (using read-string). + "Read a dired shell command prompting with PROMPT (using read-shell-command). ARG is the prefix arg and may be used to indicate in the prompt which - files are affected. +FILES are affected. This is an extra function so that you can redefine it." - (dired-mark-pop-up - nil 'shell files - 'dired-guess-shell-command - (format prompt (dired-mark-prompt arg files)) ; PROMPT - files)) ; FILES + (minibuffer-with-setup-hook + (lambda () + (set (make-local-variable 'minibuffer-default-add-function) + 'minibuffer-default-add-dired-shell-commands)) + (dired-mark-pop-up + nil 'shell files + 'dired-guess-shell-command + (format prompt (dired-mark-prompt arg files)) ; PROMPT + files))) ; FILES ;;; RELATIVE SYMBOLIC LINKS. |