Fix previous change in minibuffer-default-add-dired-shell-commands
The mailcap minibuffer completion used dynamic binding. Locally set a dynamic variable. * lisp/dired-aux.el (minibuffer-default-add-dired-shell-commands): Store list of files in 'minibuffer-completion-table'. (Bug#31794)
This commit is contained in:
parent
7caeef1622
commit
bbc9d3793d
1 changed files with 8 additions and 6 deletions
|
@ -614,14 +614,16 @@ with a prefix argument."
|
||||||
|
|
||||||
(declare-function mailcap-file-default-commands "mailcap" (files))
|
(declare-function mailcap-file-default-commands "mailcap" (files))
|
||||||
|
|
||||||
|
(defvar dired-aux-files)
|
||||||
|
|
||||||
(defun minibuffer-default-add-dired-shell-commands ()
|
(defun minibuffer-default-add-dired-shell-commands ()
|
||||||
"Return a list of all commands associated with current dired files.
|
"Return a list of all commands associated with current dired files.
|
||||||
This function is used to add all related commands retrieved by `mailcap'
|
This function is used to add all related commands retrieved by `mailcap'
|
||||||
to the end of the list of defaults just after the default value."
|
to the end of the list of defaults just after the default value."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((files minibuffer-completion-table)
|
(let ((commands (and (boundp 'dired-aux-files)
|
||||||
(commands (and (require 'mailcap nil t)
|
(require 'mailcap nil t)
|
||||||
(mailcap-file-default-commands files))))
|
(mailcap-file-default-commands dired-aux-files))))
|
||||||
(if (listp minibuffer-default)
|
(if (listp minibuffer-default)
|
||||||
(append minibuffer-default commands)
|
(append minibuffer-default commands)
|
||||||
(cons minibuffer-default commands))))
|
(cons minibuffer-default commands))))
|
||||||
|
@ -639,9 +641,9 @@ This normally reads using `read-shell-command', but if the
|
||||||
offer a smarter default choice of shell command."
|
offer a smarter default choice of shell command."
|
||||||
(minibuffer-with-setup-hook
|
(minibuffer-with-setup-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(set (make-local-variable 'minibuffer-completion-table) files)
|
(setq-local dired-aux-files files)
|
||||||
(set (make-local-variable 'minibuffer-default-add-function)
|
(setq-local minibuffer-default-add-function
|
||||||
'minibuffer-default-add-dired-shell-commands))
|
#'minibuffer-default-add-dired-shell-commands))
|
||||||
(setq prompt (format prompt (dired-mark-prompt arg files)))
|
(setq prompt (format prompt (dired-mark-prompt arg files)))
|
||||||
(if (functionp 'dired-guess-shell-command)
|
(if (functionp 'dired-guess-shell-command)
|
||||||
(dired-mark-pop-up nil 'shell files
|
(dired-mark-pop-up nil 'shell files
|
||||||
|
|
Loading…
Add table
Reference in a new issue