changeset 8604:7fff44ad20c9

(shell-command-on-region): Don't delete current buffer.
author Karl Heuer <kwzh@gnu.org>
date Wed, 24 Aug 1994 00:55:52 +0000
parents babcbeaa211f
children 1680d8306eae
files lisp/simple.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Wed Aug 24 00:39:46 1994 +0000
+++ b/lisp/simple.el	Wed Aug 24 00:55:52 1994 +0000
@@ -771,8 +771,9 @@
 	(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.