Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
1a4086d2
Commit
1a4086d2
authored
Oct 07, 1994
by
Richard M. Stallman
Browse files
(comint-check-proc): Recognise `open'.
(comint-exec): Use open-network-stream if command is a cons pair.
parent
210cf16d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
lisp/comint.el
lisp/comint.el
+13
-6
No files found.
lisp/comint.el
View file @
1a4086d2
...
...
@@ -486,10 +486,10 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
(
defun
comint-check-proc
(
buffer
)
"Return t if there is a living process associated w/buffer BUFFER.
Living means the status is `run' or `stop'.
Living means the status is
`open',
`run'
,
or `stop'.
BUFFER can be either a buffer or the name of one."
(
let
((
proc
(
get-buffer-process
buffer
)))
(
and
proc
(
memq
(
process-status
proc
)
'
(
run
stop
)))))
(
and
proc
(
memq
(
process-status
proc
)
'
(
open
run
stop
)))))
;;; Note that this guy, unlike shell.el's make-shell, barfs if you pass it ()
;;; for the second argument (program).
...
...
@@ -497,9 +497,13 @@ BUFFER can be either a buffer or the name of one."
(
defun
make-comint
(
name
program
&optional
startfile
&rest
switches
)
"Make a comint process NAME in a buffer, running PROGRAM.
The name of the buffer is made by surrounding NAME with `*'s.
If there is already a running process in that buffer, it is not restarted.
Optional third arg STARTFILE is the name of a file to send the contents of to
the process. Any more args are arguments to PROGRAM."
PROGRAM should be either a string denoting an executable program to create
via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP
connection to be opened via `open-network-stream'. If there is already a
running process in that buffer, it is not restarted. Optional third arg
STARTFILE is the name of a file to send the contents of to the process.
If PROGRAM is a string, any more args are arguments to PROGRAM."
(
let
((
buffer
(
get-buffer-create
(
concat
"*"
name
"*"
))))
;; If no process, or nuked process, crank up a new one and put buffer in
;; comint mode. Otherwise, leave buffer and existing process alone.
...
...
@@ -532,7 +536,10 @@ buffer. The hook `comint-exec-hook' is run after each exec."
(
let
((
proc
(
get-buffer-process
buffer
)))
; Blast any old process.
(
if
proc
(
delete-process
proc
)))
;; Crank up a new process
(
let
((
proc
(
comint-exec-1
name
buffer
command
switches
)))
(
let
((
proc
(
if
(
consp
command
)
(
open-network-stream
name
buffer
(
car
command
)
(
cdr
command
))
(
comint-exec-1
name
buffer
command
switches
))))
(
set-process-filter
proc
'comint-output-filter
)
(
make-local-variable
'comint-ptyp
)
(
setq
comint-ptyp
process-connection-type
)
; T if pty, NIL if pipe.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment