aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-08-16 19:52:48 +0200
committerStefan Kangas2022-08-17 16:22:29 +0200
commit9dfabe075698760bd74580d97f647cb2a6a32f1b (patch)
tree88486f08b224880f7f272b8bc93438735c9a4d41
parenta6412b96e72c32ee981f469a564c8d2155d575aa (diff)
downloademacs-9dfabe075698760bd74580d97f647cb2a6a32f1b.tar.gz
emacs-9dfabe075698760bd74580d97f647cb2a6a32f1b.zip
Assume dired-guess is now always available
* lisp/dired-aux.el (dired-read-shell-command): Use dired-guess-shell-command unconditionally, as it is now always available. (dired-do-shell-command): Doc fix; dired-guess is always available. * lisp/dired.el (dired-do-man): Don't require dired-x.
-rw-r--r--lisp/dired-aux.el14
-rw-r--r--lisp/dired.el4
2 files changed, 5 insertions, 13 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 426273f65e8..94b2baf72d0 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -780,20 +780,16 @@ which is replaced by the value returned by `dired-mark-prompt',
780with ARG and FILES as its arguments. FILES should be a list of 780with ARG and FILES as its arguments. FILES should be a list of
781file names. The result is used as the prompt. 781file names. The result is used as the prompt.
782 782
783This normally reads using `read-shell-command', but if the 783Use `dired-guess-shell-command' to offer a smarter default choice
784`dired-x' package is loaded, use `dired-guess-shell-command' to 784of shell command."
785offer a smarter default choice of shell command."
786 (minibuffer-with-setup-hook 785 (minibuffer-with-setup-hook
787 (lambda () 786 (lambda ()
788 (setq-local dired-aux-files files) 787 (setq-local dired-aux-files files)
789 (setq-local minibuffer-default-add-function 788 (setq-local minibuffer-default-add-function
790 #'dired-minibuffer-default-add-shell-commands)) 789 #'dired-minibuffer-default-add-shell-commands))
791 (setq prompt (format prompt (dired-mark-prompt arg files))) 790 (setq prompt (format prompt (dired-mark-prompt arg files)))
792 (if (functionp 'dired-guess-shell-command) 791 (dired-mark-pop-up nil 'shell files
793 (dired-mark-pop-up nil 'shell files 792 'dired-guess-shell-command prompt files)))
794 'dired-guess-shell-command prompt files)
795 (dired-mark-pop-up nil 'shell files
796 'read-shell-command prompt nil nil))))
797 793
798;;;###autoload 794;;;###autoload
799(defcustom dired-confirm-shell-command t 795(defcustom dired-confirm-shell-command t
@@ -882,7 +878,7 @@ In a noninteractive call (from Lisp code), you must specify
882the list of file names explicitly with the FILE-LIST argument, which 878the list of file names explicitly with the FILE-LIST argument, which
883can be produced by `dired-get-marked-files', for example. 879can be produced by `dired-get-marked-files', for example.
884 880
885If `dired-x' is loaded, `dired-guess-shell-alist-default' and 881`dired-guess-shell-alist-default' and
886`dired-guess-shell-alist-user' are consulted when the user is 882`dired-guess-shell-alist-user' are consulted when the user is
887prompted for the shell command to use interactively. 883prompted for the shell command to use interactively.
888 884
diff --git a/lisp/dired.el b/lisp/dired.el
index 799a9f4716b..01098fdf891 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -4919,16 +4919,12 @@ Interactively with prefix argument, read FILE-NAME."
4919;;; Miscellaneous commands 4919;;; Miscellaneous commands
4920 4920
4921(declare-function Man-getpage-in-background "man" (topic)) 4921(declare-function Man-getpage-in-background "man" (topic))
4922(declare-function dired-guess-shell-command "dired-x" (prompt files))
4923(defvar manual-program) ; from man.el 4922(defvar manual-program) ; from man.el
4924 4923
4925(defun dired-do-man () 4924(defun dired-do-man ()
4926 "In Dired, run `man' on this file." 4925 "In Dired, run `man' on this file."
4927 (interactive nil dired-mode) 4926 (interactive nil dired-mode)
4928 (require 'man) 4927 (require 'man)
4929 ;; FIXME: Move `dired-guess-shell-command' to dired.el to remove the
4930 ;; need for requiring `dired-x'.
4931 (require 'dired-x)
4932 (let* ((file (dired-get-file-for-visit)) 4928 (let* ((file (dired-get-file-for-visit))
4933 (manual-program (string-replace "*" "%s" 4929 (manual-program (string-replace "*" "%s"
4934 (dired-guess-shell-command 4930 (dired-guess-shell-command