diff options
| author | Richard M. Stallman | 1994-10-07 10:20:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-07 10:20:37 +0000 |
| commit | 1a4086d274b53fe340ffc9843e93b393bdab3099 (patch) | |
| tree | 61283ff8cdc6706981d823146a89de39685d2df7 | |
| parent | 210cf16d3191e5f05d805cded4746d70e407e57d (diff) | |
| download | emacs-1a4086d274b53fe340ffc9843e93b393bdab3099.tar.gz emacs-1a4086d274b53fe340ffc9843e93b393bdab3099.zip | |
(comint-check-proc): Recognise `open'.
(comint-exec): Use open-network-stream if command is a cons pair.
| -rw-r--r-- | lisp/comint.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index e3572ba4003..3cb4231d042 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -486,10 +486,10 @@ Entry to this mode runs the hooks on `comint-mode-hook'." | |||
| 486 | 486 | ||
| 487 | (defun comint-check-proc (buffer) | 487 | (defun comint-check-proc (buffer) |
| 488 | "Return t if there is a living process associated w/buffer BUFFER. | 488 | "Return t if there is a living process associated w/buffer BUFFER. |
| 489 | Living means the status is `run' or `stop'. | 489 | Living means the status is `open', `run', or `stop'. |
| 490 | BUFFER can be either a buffer or the name of one." | 490 | BUFFER can be either a buffer or the name of one." |
| 491 | (let ((proc (get-buffer-process buffer))) | 491 | (let ((proc (get-buffer-process buffer))) |
| 492 | (and proc (memq (process-status proc) '(run stop))))) | 492 | (and proc (memq (process-status proc) '(open run stop))))) |
| 493 | 493 | ||
| 494 | ;;; Note that this guy, unlike shell.el's make-shell, barfs if you pass it () | 494 | ;;; Note that this guy, unlike shell.el's make-shell, barfs if you pass it () |
| 495 | ;;; for the second argument (program). | 495 | ;;; for the second argument (program). |
| @@ -497,9 +497,13 @@ BUFFER can be either a buffer or the name of one." | |||
| 497 | (defun make-comint (name program &optional startfile &rest switches) | 497 | (defun make-comint (name program &optional startfile &rest switches) |
| 498 | "Make a comint process NAME in a buffer, running PROGRAM. | 498 | "Make a comint process NAME in a buffer, running PROGRAM. |
| 499 | The name of the buffer is made by surrounding NAME with `*'s. | 499 | The name of the buffer is made by surrounding NAME with `*'s. |
| 500 | If there is already a running process in that buffer, it is not restarted. | 500 | PROGRAM should be either a string denoting an executable program to create |
| 501 | Optional third arg STARTFILE is the name of a file to send the contents of to | 501 | via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP |
| 502 | the process. Any more args are arguments to PROGRAM." | 502 | connection to be opened via `open-network-stream'. If there is already a |
| 503 | running process in that buffer, it is not restarted. Optional third arg | ||
| 504 | STARTFILE is the name of a file to send the contents of to the process. | ||
| 505 | |||
| 506 | If PROGRAM is a string, any more args are arguments to PROGRAM." | ||
| 503 | (let ((buffer (get-buffer-create (concat "*" name "*")))) | 507 | (let ((buffer (get-buffer-create (concat "*" name "*")))) |
| 504 | ;; If no process, or nuked process, crank up a new one and put buffer in | 508 | ;; If no process, or nuked process, crank up a new one and put buffer in |
| 505 | ;; comint mode. Otherwise, leave buffer and existing process alone. | 509 | ;; comint mode. Otherwise, leave buffer and existing process alone. |
| @@ -532,7 +536,10 @@ buffer. The hook `comint-exec-hook' is run after each exec." | |||
| 532 | (let ((proc (get-buffer-process buffer))) ; Blast any old process. | 536 | (let ((proc (get-buffer-process buffer))) ; Blast any old process. |
| 533 | (if proc (delete-process proc))) | 537 | (if proc (delete-process proc))) |
| 534 | ;; Crank up a new process | 538 | ;; Crank up a new process |
| 535 | (let ((proc (comint-exec-1 name buffer command switches))) | 539 | (let ((proc |
| 540 | (if (consp command) | ||
| 541 | (open-network-stream name buffer (car command) (cdr command)) | ||
| 542 | (comint-exec-1 name buffer command switches)))) | ||
| 536 | (set-process-filter proc 'comint-output-filter) | 543 | (set-process-filter proc 'comint-output-filter) |
| 537 | (make-local-variable 'comint-ptyp) | 544 | (make-local-variable 'comint-ptyp) |
| 538 | (setq comint-ptyp process-connection-type) ; T if pty, NIL if pipe. | 545 | (setq comint-ptyp process-connection-type) ; T if pty, NIL if pipe. |