]> git.eshelyaron.com Git - emacs.git/commitdiff
(shell-command-on-region): Don't delete current buffer.
authorKarl Heuer <kwzh@gnu.org>
Wed, 24 Aug 1994 00:55:52 +0000 (00:55 +0000)
committerKarl Heuer <kwzh@gnu.org>
Wed, 24 Aug 1994 00:55:52 +0000 (00:55 +0000)
lisp/simple.el

index fc0a7fc80690f89fa42c3c8f7b1031de836952d9..8dc5fa1af740c0f7634d4f18d458c72f4a751157 100644 (file)
@@ -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.