aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2018-06-12 12:24:09 +0800
committerEli Zaretskii2018-06-23 16:45:58 +0300
commitbbc9d3793d86b855045ed322253f687fcd82aa68 (patch)
tree935481dc3e72c2ec5c5b04aac7f00ee54e67fb00
parent7caeef1622114d62570d507c4b4ba0f647bb4491 (diff)
downloademacs-bbc9d3793d86b855045ed322253f687fcd82aa68.tar.gz
emacs-bbc9d3793d86b855045ed322253f687fcd82aa68.zip
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)
-rw-r--r--lisp/dired-aux.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index c336103f80b..516cd2c5672 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -614,14 +614,16 @@ with a prefix argument."
614 614
615(declare-function mailcap-file-default-commands "mailcap" (files)) 615(declare-function mailcap-file-default-commands "mailcap" (files))
616 616
617(defvar dired-aux-files)
618
617(defun minibuffer-default-add-dired-shell-commands () 619(defun minibuffer-default-add-dired-shell-commands ()
618 "Return a list of all commands associated with current dired files. 620 "Return a list of all commands associated with current dired files.
619This function is used to add all related commands retrieved by `mailcap' 621This function is used to add all related commands retrieved by `mailcap'
620to the end of the list of defaults just after the default value." 622to the end of the list of defaults just after the default value."
621 (interactive) 623 (interactive)
622 (let* ((files minibuffer-completion-table) 624 (let ((commands (and (boundp 'dired-aux-files)
623 (commands (and (require 'mailcap nil t) 625 (require 'mailcap nil t)
624 (mailcap-file-default-commands files)))) 626 (mailcap-file-default-commands dired-aux-files))))
625 (if (listp minibuffer-default) 627 (if (listp minibuffer-default)
626 (append minibuffer-default commands) 628 (append minibuffer-default commands)
627 (cons minibuffer-default commands)))) 629 (cons minibuffer-default commands))))
@@ -639,9 +641,9 @@ This normally reads using `read-shell-command', but if the
639offer a smarter default choice of shell command." 641offer a smarter default choice of shell command."
640 (minibuffer-with-setup-hook 642 (minibuffer-with-setup-hook
641 (lambda () 643 (lambda ()
642 (set (make-local-variable 'minibuffer-completion-table) files) 644 (setq-local dired-aux-files files)
643 (set (make-local-variable 'minibuffer-default-add-function) 645 (setq-local minibuffer-default-add-function
644 'minibuffer-default-add-dired-shell-commands)) 646 #'minibuffer-default-add-dired-shell-commands))
645 (setq prompt (format prompt (dired-mark-prompt arg files))) 647 (setq prompt (format prompt (dired-mark-prompt arg files)))
646 (if (functionp 'dired-guess-shell-command) 648 (if (functionp 'dired-guess-shell-command)
647 (dired-mark-pop-up nil 'shell files 649 (dired-mark-pop-up nil 'shell files