aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-02-23 05:02:54 +0000
committerRichard M. Stallman1995-02-23 05:02:54 +0000
commitcae49185e5fe9f630b36582f3dabe309141fcdb3 (patch)
treeeb825a3a3059adc258025fa4061bfc721f77527f
parentd9f86af9ab45faa9b400ec395446899579582983 (diff)
downloademacs-cae49185e5fe9f630b36582f3dabe309141fcdb3.tar.gz
emacs-cae49185e5fe9f630b36582f3dabe309141fcdb3.zip
(shell-command-on-region): When computing interactive args,
read the minibuffer arg first, then get the region bounds.
-rw-r--r--lisp/simple.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index fff374342cb..194c9740cac 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -795,11 +795,17 @@ If OUTPUT-BUFFER is a buffer or buffer name, put the output there.
795If OUTPUT-BUFFER is not a buffer and not nil, 795If OUTPUT-BUFFER is not a buffer and not nil,
796insert output in the current buffer. 796insert output in the current buffer.
797In either case, the output is inserted after point (leaving mark after it)." 797In either case, the output is inserted after point (leaving mark after it)."
798 (interactive (list (region-beginning) (region-end) 798 (interactive (let ((string
799 (read-from-minibuffer "Shell command on region: " 799 ;; Do this before calling region-beginning
800 nil nil nil 'shell-command-history) 800 ;; and region-end, in case subprocess output
801 current-prefix-arg 801 ;; relocates them while we are in the minibuffer.
802 (prefix-numeric-value current-prefix-arg))) 802 (read-from-minibuffer "Shell command on region: "
803 nil nil nil
804 'shell-command-history)))
805 (list (region-beginning) (region-end)
806 string
807 current-prefix-arg
808 (prefix-numeric-value current-prefix-arg))))
803 (if (and output-buffer 809 (if (and output-buffer
804 (not (or (bufferp output-buffer) (stringp output-buffer)))) 810 (not (or (bufferp output-buffer) (stringp output-buffer))))
805 ;; Replace specified region with output from command. 811 ;; Replace specified region with output from command.