(shell-command, shell-command-on-region):

Fix bugs in previous change.
This commit is contained in:
Richard M. Stallman 1993-08-08 07:47:33 +00:00
parent 6f5d1a4f52
commit aa00b92d69

View file

@ -630,9 +630,6 @@ then call `undo-more' one or more times to undo them."
(error "No further undo information")) (error "No further undo information"))
(setq pending-undo-list (primitive-undo count pending-undo-list))) (setq pending-undo-list (primitive-undo count pending-undo-list)))
(defvar last-shell-command "")
(defvar last-shell-command-on-region "")
(defvar shell-command-history nil (defvar shell-command-history nil
"History list for some commands that read shell commands.") "History list for some commands that read shell commands.")
@ -643,8 +640,9 @@ If COMMAND ends in ampersand, execute it asynchronously.
Optional second arg non-nil (prefix arg, if interactive) Optional second arg non-nil (prefix arg, if interactive)
means insert output in current buffer after point (leave mark after it). means insert output in current buffer after point (leave mark after it).
This cannot be done asynchronously." This cannot be done asynchronously."
(interactive (list (read-string "Shell command: " last-shell-command) (interactive (list (read-from-minibuffer "Shell command: "
current-prefix-arg nil nil 'shell-command-history)) nil nil nil 'shell-command-history)
current-prefix-arg))
(if flag (if flag
(progn (barf-if-buffer-read-only) (progn (barf-if-buffer-read-only)
(push-mark) (push-mark)
@ -738,9 +736,8 @@ even though that buffer is not automatically displayed. If there is no output
or output is inserted in the current buffer then `*Shell Command Output*' is or output is inserted in the current buffer then `*Shell Command Output*' is
deleted." deleted."
(interactive (list (region-beginning) (region-end) (interactive (list (region-beginning) (region-end)
(read-string "Shell command on region: " (read-from-minibuffer "Shell command on region: "
last-shell-command-on-region nil nil nil 'shell-command-history)
nil nil 'shell-command-history)
current-prefix-arg current-prefix-arg
(prefix-numeric-value current-prefix-arg))) (prefix-numeric-value current-prefix-arg)))
(if flag (if flag