diff options
| author | Miles Bader | 2000-10-27 08:00:32 +0000 |
|---|---|---|
| committer | Miles Bader | 2000-10-27 08:00:32 +0000 |
| commit | a7fd458a8c8548929ac0c499a42ffa7dc6c2c7a1 (patch) | |
| tree | a8654a58c683e207023ef7277ce2f01b5ea3d5d1 | |
| parent | 05ea7ef21a0f047b31205de0434af6bc3a42dfcd (diff) | |
| download | emacs-a7fd458a8c8548929ac0c499a42ffa7dc6c2c7a1.tar.gz emacs-a7fd458a8c8548929ac0c499a42ffa7dc6c2c7a1.zip | |
(make-comint-in-buffer): New function.
(make-comint): Use it.
| -rw-r--r-- | lisp/comint.el | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 8b23aa62b28..d42a2ef0a86 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -640,6 +640,28 @@ BUFFER can be either a buffer or the name of one." | |||
| 640 | (and proc (memq (process-status proc) '(open run stop))))) | 640 | (and proc (memq (process-status proc) '(open run stop))))) |
| 641 | 641 | ||
| 642 | ;;;###autoload | 642 | ;;;###autoload |
| 643 | (defun make-comint-in-buffer (name buffer program &optional startfile &rest switches) | ||
| 644 | "Make a comint process NAME in BUFFER, running PROGRAM. | ||
| 645 | If BUFFER is nil, it defaults to NAME surrounded by `*'s. | ||
| 646 | PROGRAM should be either a string denoting an executable program to create | ||
| 647 | via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP | ||
| 648 | connection to be opened via `open-network-stream'. If there is already a | ||
| 649 | running process in that buffer, it is not restarted. Optional third arg | ||
| 650 | STARTFILE is the name of a file to send the contents of to the process. | ||
| 651 | |||
| 652 | If PROGRAM is a string, any more args are arguments to PROGRAM." | ||
| 653 | (or (fboundp 'start-process) | ||
| 654 | (error "Multi-processing is not supported for this system")) | ||
| 655 | (setq buffer (get-buffer-create (or buffer (concat "*" name "*")))) | ||
| 656 | ;; If no process, or nuked process, crank up a new one and put buffer in | ||
| 657 | ;; comint mode. Otherwise, leave buffer and existing process alone. | ||
| 658 | (unless (comint-check-proc buffer) | ||
| 659 | (with-current-buffer buffer | ||
| 660 | (comint-mode)) ; Install local vars, mode, keymap, ... | ||
| 661 | (comint-exec buffer name program startfile switches)) | ||
| 662 | buffer) | ||
| 663 | |||
| 664 | ;;;###autoload | ||
| 643 | (defun make-comint (name program &optional startfile &rest switches) | 665 | (defun make-comint (name program &optional startfile &rest switches) |
| 644 | "Make a comint process NAME in a buffer, running PROGRAM. | 666 | "Make a comint process NAME in a buffer, running PROGRAM. |
| 645 | The name of the buffer is made by surrounding NAME with `*'s. | 667 | The name of the buffer is made by surrounding NAME with `*'s. |
| @@ -650,16 +672,7 @@ running process in that buffer, it is not restarted. Optional third arg | |||
| 650 | STARTFILE is the name of a file to send the contents of to the process. | 672 | STARTFILE is the name of a file to send the contents of to the process. |
| 651 | 673 | ||
| 652 | If PROGRAM is a string, any more args are arguments to PROGRAM." | 674 | If PROGRAM is a string, any more args are arguments to PROGRAM." |
| 653 | (or (fboundp 'start-process) | 675 | (apply #'make-comint-in-buffer name nil program startfile switches)) |
| 654 | (error "Multi-processing is not supported for this system")) | ||
| 655 | (let ((buffer (get-buffer-create (concat "*" name "*")))) | ||
| 656 | ;; If no process, or nuked process, crank up a new one and put buffer in | ||
| 657 | ;; comint mode. Otherwise, leave buffer and existing process alone. | ||
| 658 | (unless (comint-check-proc buffer) | ||
| 659 | (with-current-buffer buffer | ||
| 660 | (comint-mode)) ; Install local vars, mode, keymap, ... | ||
| 661 | (comint-exec buffer name program startfile switches)) | ||
| 662 | buffer)) | ||
| 663 | 676 | ||
| 664 | ;;;###autoload | 677 | ;;;###autoload |
| 665 | (defun comint-run (program) | 678 | (defun comint-run (program) |