Mercurial > emacs
comparison lisp/simple.el @ 9065:e321617e3fc6
(shell-command, shell-command-on-region):
Make "*Shell Command Output*" non-read-only.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 24 Sep 1994 04:52:10 +0000 |
parents | 25406f41c336 |
children | ee9866892683 |
comparison
equal
deleted
inserted
replaced
9064:d716ea8937e2 | 9065:e321617e3fc6 |
---|---|
699 (if (yes-or-no-p "A command is running. Kill it? ") | 699 (if (yes-or-no-p "A command is running. Kill it? ") |
700 (kill-process proc) | 700 (kill-process proc) |
701 (error "Shell command in progress"))) | 701 (error "Shell command in progress"))) |
702 (save-excursion | 702 (save-excursion |
703 (set-buffer buffer) | 703 (set-buffer buffer) |
704 (setq buffer-read-only nil) | |
704 (erase-buffer) | 705 (erase-buffer) |
705 (display-buffer buffer) | 706 (display-buffer buffer) |
706 (setq default-directory directory) | 707 (setq default-directory directory) |
707 (setq proc (start-process "Shell" buffer | 708 (setq proc (start-process "Shell" buffer |
708 shell-file-name "-c" command)) | 709 shell-file-name "-c" command)) |
786 (unwind-protect | 787 (unwind-protect |
787 (if (eq buffer (current-buffer)) | 788 (if (eq buffer (current-buffer)) |
788 ;; If the input is the same buffer as the output, | 789 ;; If the input is the same buffer as the output, |
789 ;; delete everything but the specified region, | 790 ;; delete everything but the specified region, |
790 ;; then replace that region with the output. | 791 ;; then replace that region with the output. |
791 (progn (delete-region end (point-max)) | 792 (progn (setq buffer-read-only nil) |
793 (delete-region end (point-max)) | |
792 (delete-region (point-min) start) | 794 (delete-region (point-min) start) |
793 (call-process-region (point-min) (point-max) | 795 (call-process-region (point-min) (point-max) |
794 shell-file-name t t nil | 796 shell-file-name t t nil |
795 "-c" command) | 797 "-c" command) |
796 (setq success t)) | 798 (setq success t)) |
797 ;; Clear the output buffer, then run the command with output there. | 799 ;; Clear the output buffer, then run the command with output there. |
798 (save-excursion | 800 (save-excursion |
799 (set-buffer buffer) | 801 (set-buffer buffer) |
802 (setq buffer-read-only nil) | |
800 (erase-buffer)) | 803 (erase-buffer)) |
801 (call-process-region start end shell-file-name | 804 (call-process-region start end shell-file-name |
802 nil buffer nil | 805 nil buffer nil |
803 "-c" command) | 806 "-c" command) |
804 (setq success t)) | 807 (setq success t)) |