Commit b5f7c943 authored by Karl Heuer's avatar Karl Heuer
Browse files

(shell-command-on-region): Don't delete current buffer.

parent 857e63c2
......@@ -771,8 +771,9 @@ deleted."
(and interactive (push-mark))
(call-process-region start end shell-file-name t t nil
"-c" command)
(if (get-buffer "*Shell Command Output*")
(kill-buffer "*Shell Command Output*"))
(let ((shell-buffer (get-buffer "*Shell Command Output*")))
(and shell-buffer (not (eq shell-buffer (current-buffer)))
(kill-buffer shell-buffer)))
(and interactive swap (exchange-point-and-mark)))
;; No prefix argument: put the output in a temp buffer,
;; replacing its entire contents.
......
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