diff options
| author | Richard M. Stallman | 1995-02-23 05:02:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-02-23 05:02:54 +0000 |
| commit | cae49185e5fe9f630b36582f3dabe309141fcdb3 (patch) | |
| tree | eb825a3a3059adc258025fa4061bfc721f77527f | |
| parent | d9f86af9ab45faa9b400ec395446899579582983 (diff) | |
| download | emacs-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.el | 16 |
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. | |||
| 795 | If OUTPUT-BUFFER is not a buffer and not nil, | 795 | If OUTPUT-BUFFER is not a buffer and not nil, |
| 796 | insert output in the current buffer. | 796 | insert output in the current buffer. |
| 797 | In either case, the output is inserted after point (leaving mark after it)." | 797 | In 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. |