comparison lisp/simple.el @ 38027:a18180dc7aa1

(shell-command-on-region): Never kill the *Shell Command Output* buffer.
author Richard M. Stallman <rms@gnu.org>
date Wed, 13 Jun 2001 15:26:29 +0000
parents 5bd4843858ae
children 4bbb59858499
comparison
equal deleted inserted replaced
38026:ad9617225b8d 38027:a18180dc7aa1
1432 (call-process-region start end shell-file-name t 1432 (call-process-region start end shell-file-name t
1433 (if error-file 1433 (if error-file
1434 (list t error-file) 1434 (list t error-file)
1435 t) 1435 t)
1436 nil shell-command-switch command)) 1436 nil shell-command-switch command))
1437 (let ((shell-buffer (get-buffer "*Shell Command Output*"))) 1437 ;;; It is rude to delete a buffer which the command is not using.
1438 (and shell-buffer (not (eq shell-buffer (current-buffer))) 1438 ;;; (let ((shell-buffer (get-buffer "*Shell Command Output*")))
1439 (kill-buffer shell-buffer))) 1439 ;;; (and shell-buffer (not (eq shell-buffer (current-buffer)))
1440 ;;; (kill-buffer shell-buffer)))
1440 ;; Don't muck with mark unless REPLACE says we should. 1441 ;; Don't muck with mark unless REPLACE says we should.
1441 (and replace swap (exchange-point-and-mark))) 1442 (and replace swap (exchange-point-and-mark)))
1442 ;; No prefix argument: put the output in a temp buffer, 1443 ;; No prefix argument: put the output in a temp buffer,
1443 ;; replacing its entire contents. 1444 ;; replacing its entire contents.
1444 (let ((buffer (get-buffer-create 1445 (let ((buffer (get-buffer-create
1483 ;; No output; error? 1484 ;; No output; error?
1484 (message (if (and error-file 1485 (message (if (and error-file
1485 (< 0 (nth 7 (file-attributes error-file)))) 1486 (< 0 (nth 7 (file-attributes error-file))))
1486 "(Shell command %sed with some error output)" 1487 "(Shell command %sed with some error output)"
1487 "(Shell command %sed with no output)") 1488 "(Shell command %sed with no output)")
1488 (if (equal 0 exit-status) "succeed" "fail")) 1489 (if (equal 0 exit-status) "succeed" "fail"))))))
1489 (kill-buffer buffer)))))
1490 1490
1491 (when (and error-file (file-exists-p error-file)) 1491 (when (and error-file (file-exists-p error-file))
1492 (if (< 0 (nth 7 (file-attributes error-file))) 1492 (if (< 0 (nth 7 (file-attributes error-file)))
1493 (with-current-buffer (get-buffer-create error-buffer) 1493 (with-current-buffer (get-buffer-create error-buffer)
1494 (let ((pos-from-end (- (point-max) (point)))) 1494 (let ((pos-from-end (- (point-max) (point))))