Mercurial > emacs
comparison lisp/comint.el @ 81801:2e8d5916d236
* comint.el (make-comint, make-comint-in-buffer)
(comint-exec-1): Replace `start-process' by `start-file-process'.
* progmodes/compile.el (compilation-start): Revert redefining
`start-process'.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Tue, 10 Jul 2007 19:52:11 +0000 |
parents | 56f63de10254 |
children | 64c8ecd78bf2 |
comparison
equal
deleted
inserted
replaced
81800:e29d41367d51 | 81801:2e8d5916d236 |
---|---|
668 ;;;###autoload | 668 ;;;###autoload |
669 (defun make-comint-in-buffer (name buffer program &optional startfile &rest switches) | 669 (defun make-comint-in-buffer (name buffer program &optional startfile &rest switches) |
670 "Make a Comint process NAME in BUFFER, running PROGRAM. | 670 "Make a Comint process NAME in BUFFER, running PROGRAM. |
671 If BUFFER is nil, it defaults to NAME surrounded by `*'s. | 671 If BUFFER is nil, it defaults to NAME surrounded by `*'s. |
672 PROGRAM should be either a string denoting an executable program to create | 672 PROGRAM should be either a string denoting an executable program to create |
673 via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP | 673 via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting |
674 connection to be opened via `open-network-stream'. If there is already a | 674 a TCP connection to be opened via `open-network-stream'. If there is already |
675 running process in that buffer, it is not restarted. Optional fourth arg | 675 a running process in that buffer, it is not restarted. Optional fourth arg |
676 STARTFILE is the name of a file to send the contents of to the process. | 676 STARTFILE is the name of a file to send the contents of to the process. |
677 | 677 |
678 If PROGRAM is a string, any more args are arguments to PROGRAM." | 678 If PROGRAM is a string, any more args are arguments to PROGRAM." |
679 (or (fboundp 'start-process) | 679 (or (fboundp 'start-file-process) |
680 (error "Multi-processing is not supported for this system")) | 680 (error "Multi-processing is not supported for this system")) |
681 (setq buffer (get-buffer-create (or buffer (concat "*" name "*")))) | 681 (setq buffer (get-buffer-create (or buffer (concat "*" name "*")))) |
682 ;; If no process, or nuked process, crank up a new one and put buffer in | 682 ;; If no process, or nuked process, crank up a new one and put buffer in |
683 ;; comint mode. Otherwise, leave buffer and existing process alone. | 683 ;; comint mode. Otherwise, leave buffer and existing process alone. |
684 (unless (comint-check-proc buffer) | 684 (unless (comint-check-proc buffer) |
691 ;;;###autoload | 691 ;;;###autoload |
692 (defun make-comint (name program &optional startfile &rest switches) | 692 (defun make-comint (name program &optional startfile &rest switches) |
693 "Make a Comint process NAME in a buffer, running PROGRAM. | 693 "Make a Comint process NAME in a buffer, running PROGRAM. |
694 The name of the buffer is made by surrounding NAME with `*'s. | 694 The name of the buffer is made by surrounding NAME with `*'s. |
695 PROGRAM should be either a string denoting an executable program to create | 695 PROGRAM should be either a string denoting an executable program to create |
696 via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP | 696 via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting |
697 connection to be opened via `open-network-stream'. If there is already a | 697 a TCP connection to be opened via `open-network-stream'. If there is already |
698 running process in that buffer, it is not restarted. Optional third arg | 698 a running process in that buffer, it is not restarted. Optional third arg |
699 STARTFILE is the name of a file to send the contents of the process to. | 699 STARTFILE is the name of a file to send the contents of the process to. |
700 | 700 |
701 If PROGRAM is a string, any more args are arguments to PROGRAM." | 701 If PROGRAM is a string, any more args are arguments to PROGRAM." |
702 (apply #'make-comint-in-buffer name nil program startfile switches)) | 702 (apply #'make-comint-in-buffer name nil program startfile switches)) |
703 | 703 |
779 proc decoding encoding changed) | 779 proc decoding encoding changed) |
780 (let ((exec-path (if (file-name-directory command) | 780 (let ((exec-path (if (file-name-directory command) |
781 ;; If the command has slashes, make sure we | 781 ;; If the command has slashes, make sure we |
782 ;; first look relative to the current directory. | 782 ;; first look relative to the current directory. |
783 (cons default-directory exec-path) exec-path))) | 783 (cons default-directory exec-path) exec-path))) |
784 (setq proc (apply 'start-process name buffer command switches))) | 784 (setq proc (apply 'start-file-process name buffer command switches))) |
785 (let ((coding-systems (process-coding-system proc))) | 785 (let ((coding-systems (process-coding-system proc))) |
786 (setq decoding (car coding-systems) | 786 (setq decoding (car coding-systems) |
787 encoding (cdr coding-systems))) | 787 encoding (cdr coding-systems))) |
788 ;; If start-process decided to use some coding system for decoding | 788 ;; If start-file-process decided to use some coding system for decoding |
789 ;; data sent from the process and the coding system doesn't | 789 ;; data sent from the process and the coding system doesn't |
790 ;; specify EOL conversion, we had better convert CRLF to LF. | 790 ;; specify EOL conversion, we had better convert CRLF to LF. |
791 (if (vectorp (coding-system-eol-type decoding)) | 791 (if (vectorp (coding-system-eol-type decoding)) |
792 (setq decoding (coding-system-change-eol-conversion decoding 'dos) | 792 (setq decoding (coding-system-change-eol-conversion decoding 'dos) |
793 changed t)) | 793 changed t)) |
794 ;; Even if start-process left the coding system for encoding data | 794 ;; Even if start-file-process left the coding system for encoding data |
795 ;; sent from the process undecided, we had better use the same one | 795 ;; sent from the process undecided, we had better use the same one |
796 ;; as what we use for decoding. But, we should suppress EOL | 796 ;; as what we use for decoding. But, we should suppress EOL |
797 ;; conversion. | 797 ;; conversion. |
798 (if (and decoding (not encoding)) | 798 (if (and decoding (not encoding)) |
799 (setq encoding (coding-system-change-eol-conversion decoding 'unix) | 799 (setq encoding (coding-system-change-eol-conversion decoding 'unix) |