From b5f7c94389d17d520e8e1de6a7e42f7bd8eb57e0 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Wed, 24 Aug 1994 00:55:52 +0000 Subject: [PATCH] (shell-command-on-region): Don't delete current buffer. --- lisp/simple.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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. -- 2.39.5