# HG changeset patch # User Juri Linkov # Date 1217523081 0 # Node ID 9718b5cb3616d76cf43f0bc159864145c95bc596 # Parent 1a590c6bdbdc940bbbaf36b464f43354eb094030 (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'. diff -r 1a590c6bdbdc -r 9718b5cb3616 lisp/simple.el --- a/lisp/simple.el Thu Jul 31 16:51:09 2008 +0000 +++ b/lisp/simple.el Thu Jul 31 16:51:21 2008 +0000 @@ -2012,11 +2012,15 @@ 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 @@ (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.