From: Karl Heuer Date: Wed, 24 Aug 1994 00:55:52 +0000 (+0000) Subject: (shell-command-on-region): Don't delete current buffer. X-Git-Tag: emacs-19.34~7249 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5f7c94389d17d520e8e1de6a7e42f7bd8eb57e0;p=emacs.git (shell-command-on-region): Don't delete current buffer. --- diff --git a/lisp/simple.el b/lisp/simple.el index fc0a7fc8069..8dc5fa1af74 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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.