Commit 009ef402 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(shell-command-history): New variable.

(shell-command, shell-command-on-region): Use it.
parent 2f65feb6
......@@ -633,6 +633,9 @@ then call `undo-more' one or more times to undo them."
(defvar last-shell-command "")
(defvar last-shell-command-on-region "")
(defvar shell-command-history nil
"History list for some commands that read shell commands.")
(defun shell-command (command &optional flag)
"Execute string COMMAND in inferior shell; display output, if any.
If COMMAND ends in ampersand, execute it asynchronously.
......@@ -641,7 +644,7 @@ Optional second arg non-nil (prefix arg, if interactive)
means insert output in current buffer after point (leave mark after it).
This cannot be done asynchronously."
(interactive (list (read-string "Shell command: " last-shell-command)
current-prefix-arg nil nil 'shell-command-history))
(if flag
(progn (barf-if-buffer-read-only)
......@@ -736,7 +739,8 @@ or output is inserted in the current buffer then `*Shell Command Output*' is
(interactive (list (region-beginning) (region-end)
(read-string "Shell command on region: "
nil nil 'shell-command-history)
(prefix-numeric-value current-prefix-arg)))
(if flag
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment