]> git.eshelyaron.com Git - emacs.git/commitdiff
(shell-command-history): New variable.
authorRichard M. Stallman <rms@gnu.org>
Sat, 31 Jul 1993 06:10:44 +0000 (06:10 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 31 Jul 1993 06:10:44 +0000 (06:10 +0000)
(shell-command, shell-command-on-region): Use it.

lisp/simple.el

index c697a4c95d0a1331034434c3effb700f0f64b48b..bf99a38a11ae0d7d1537e36afcdb33c4415a1fde 100644 (file)
@@ -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))
+                    current-prefix-arg nil nil 'shell-command-history))
   (if flag
       (progn (barf-if-buffer-read-only)
             (push-mark)
@@ -736,7 +739,8 @@ or output is inserted in the current buffer then `*Shell Command Output*' is
 deleted." 
   (interactive (list (region-beginning) (region-end)
                     (read-string "Shell command on region: "
-                                 last-shell-command-on-region)
+                                 last-shell-command-on-region
+                                 nil nil 'shell-command-history)
                     current-prefix-arg
                     (prefix-numeric-value current-prefix-arg)))
   (if flag