1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-28 10:56:36 +00:00

(shell-command-on-region): Err if no mark before reading the command string.

This commit is contained in:
Richard M. Stallman 2002-02-01 04:20:02 +00:00
parent 57e46f945e
commit 195ce31160

View File

@ -1421,13 +1421,15 @@ or buffer name to which to direct the command's standard error output.
If it is nil, error output is mingled with regular output. If it is nil, error output is mingled with regular output.
In an interactive call, the variable `shell-command-default-error-buffer' In an interactive call, the variable `shell-command-default-error-buffer'
specifies the value of ERROR-BUFFER." specifies the value of ERROR-BUFFER."
(interactive (let ((string (interactive (let (string)
;; Do this before calling region-beginning (unless (mark)
;; and region-end, in case subprocess output (error "The mark is not set now, so there is no region"))
;; relocates them while we are in the minibuffer. ;; Do this before calling region-beginning
(read-from-minibuffer "Shell command on region: " ;; and region-end, in case subprocess output
nil nil nil ;; relocates them while we are in the minibuffer.
'shell-command-history))) (setq string (read-from-minibuffer "Shell command on region: "
nil nil nil
'shell-command-history))
;; call-interactively recognizes region-beginning and ;; call-interactively recognizes region-beginning and
;; region-end specially, leaving them in the history. ;; region-end specially, leaving them in the history.
(list (region-beginning) (region-end) (list (region-beginning) (region-end)