]> git.eshelyaron.com Git - emacs.git/commitdiff
(read-shell-command, shell-command):
authorJuri Linkov <juri@jurta.org>
Thu, 31 Jul 2008 16:51:21 +0000 (16:51 +0000)
committerJuri Linkov <juri@jurta.org>
Thu, 31 Jul 2008 16:51:21 +0000 (16:51 +0000)
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'.

lisp/simple.el

index cf1a73e98d7a354625219795c5631f7c4ecbaed0..db7979bdd83e2d77ee44cee5e1845e064d710fee 100644 (file)
@@ -2012,11 +2012,15 @@ to the end of the list of defaults just after the default value."
 The arguments are the same as the ones of `read-from-minibuffer',
 except READ and KEYMAP are missing and HIST defaults
 to `shell-command-history'."
-  (apply 'read-from-minibuffer prompt initial-contents
-         minibuffer-local-shell-command-map
-         nil
-         (or hist 'shell-command-history)
-         args))
+  (minibuffer-with-setup-hook
+      (lambda ()
+       (set (make-local-variable 'minibuffer-default-add-function)
+            'minibuffer-default-add-shell-commands))
+    (apply 'read-from-minibuffer prompt initial-contents
+          minibuffer-local-shell-command-map
+          nil
+          (or hist 'shell-command-history)
+          args)))
 
 (defun shell-command (command &optional output-buffer error-buffer)
   "Execute string COMMAND in inferior shell; display output, if any.
@@ -2070,13 +2074,9 @@ specifies the value of ERROR-BUFFER."
 
   (interactive
    (list
-    (minibuffer-with-setup-hook
-       (lambda ()
-         (set (make-local-variable 'minibuffer-default-add-function)
-              'minibuffer-default-add-shell-commands))
-      (read-shell-command "Shell command: " nil nil
-                         (and buffer-file-name
-                              (file-relative-name buffer-file-name))))
+    (read-shell-command "Shell command: " nil nil
+                       (and buffer-file-name
+                            (file-relative-name buffer-file-name)))
     current-prefix-arg
     shell-command-default-error-buffer))
   ;; Look for a handler in case default-directory is a remote file name.