aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2008-07-31 16:51:21 +0000
committerJuri Linkov2008-07-31 16:51:21 +0000
commitd6601455c1b34709ee02f45ddba52421a67ffb12 (patch)
tree7670e7a0afa1d5d1261c7dee27ee8687de88debf
parentc16e87ee53126a120456da8216872413f552c8d3 (diff)
downloademacs-d6601455c1b34709ee02f45ddba52421a67ffb12.tar.gz
emacs-d6601455c1b34709ee02f45ddba52421a67ffb12.zip
(read-shell-command, shell-command):
Move code that uses minibuffer-with-setup-hook to set minibuffer-default-add-function to minibuffer-default-add-shell-commands from the interactive spec of `shell-command' to `read-shell-command'.
-rw-r--r--lisp/simple.el24
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index cf1a73e98d7..db7979bdd83 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2012,11 +2012,15 @@ to the end of the list of defaults just after the default value."
2012The arguments are the same as the ones of `read-from-minibuffer', 2012The arguments are the same as the ones of `read-from-minibuffer',
2013except READ and KEYMAP are missing and HIST defaults 2013except READ and KEYMAP are missing and HIST defaults
2014to `shell-command-history'." 2014to `shell-command-history'."
2015 (apply 'read-from-minibuffer prompt initial-contents 2015 (minibuffer-with-setup-hook
2016 minibuffer-local-shell-command-map 2016 (lambda ()
2017 nil 2017 (set (make-local-variable 'minibuffer-default-add-function)
2018 (or hist 'shell-command-history) 2018 'minibuffer-default-add-shell-commands))
2019 args)) 2019 (apply 'read-from-minibuffer prompt initial-contents
2020 minibuffer-local-shell-command-map
2021 nil
2022 (or hist 'shell-command-history)
2023 args)))
2020 2024
2021(defun shell-command (command &optional output-buffer error-buffer) 2025(defun shell-command (command &optional output-buffer error-buffer)
2022 "Execute string COMMAND in inferior shell; display output, if any. 2026 "Execute string COMMAND in inferior shell; display output, if any.
@@ -2070,13 +2074,9 @@ specifies the value of ERROR-BUFFER."
2070 2074
2071 (interactive 2075 (interactive
2072 (list 2076 (list
2073 (minibuffer-with-setup-hook 2077 (read-shell-command "Shell command: " nil nil
2074 (lambda () 2078 (and buffer-file-name
2075 (set (make-local-variable 'minibuffer-default-add-function) 2079 (file-relative-name buffer-file-name)))
2076 'minibuffer-default-add-shell-commands))
2077 (read-shell-command "Shell command: " nil nil
2078 (and buffer-file-name
2079 (file-relative-name buffer-file-name))))
2080 current-prefix-arg 2080 current-prefix-arg
2081 shell-command-default-error-buffer)) 2081 shell-command-default-error-buffer))
2082 ;; Look for a handler in case default-directory is a remote file name. 2082 ;; Look for a handler in case default-directory is a remote file name.