# HG changeset patch # User Karl Heuer # Date 777689752 0 # Node ID 7fff44ad20c97668cb88479fe390aaf4650c98df # Parent babcbeaa211f9a3b9900085ca35463d927f5c8fd (shell-command-on-region): Don't delete current buffer. diff -r babcbeaa211f -r 7fff44ad20c9 lisp/simple.el --- 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.