aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorChong Yidong2012-04-19 16:09:30 +0800
committerChong Yidong2012-04-19 16:09:30 +0800
commitb668fa6eb0d46a8f3c675954dfd8ce79e6441129 (patch)
tree3ecf93953301ce744455f7eaa79d2b18d8c3a631 /lisp/comint.el
parentc5467d73aea190e3712f1e146c326ad2d94ed0bb (diff)
downloademacs-b668fa6eb0d46a8f3c675954dfd8ce79e6441129.tar.gz
emacs-b668fa6eb0d46a8f3c675954dfd8ce79e6441129.zip
Delete the gdb-inferior pty when the gdb process exits.
* lisp/progmodes/gdb-mi.el (gdb-inferior-io--maybe-delete-pty): New function to call delete-process on the gdb-inferior buffer's pty. (gdb-reset): Use it, instead of relying on kill-buffer to kill the pty process. (gdb-update): New arg to suppress talking to the gdb process. (gdb-done-or-error): Use it. (gdb-stopped-functions): Rename from gdb-stopped-hooks. (gdb): Call gdb-inferior-io--maybe-delete-pty as a workaround for sentinel not being called. * lisp/comint.el (make-comint-in-buffer, comint-exec): Doc fix. Fixes: debbugs:11273
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el34
1 files changed, 24 insertions, 10 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 68fedeb88a9..10981675971 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -699,16 +699,21 @@ BUFFER can be either a buffer or the name of one."
699(defun make-comint-in-buffer (name buffer program &optional startfile &rest switches) 699(defun make-comint-in-buffer (name buffer program &optional startfile &rest switches)
700 "Make a Comint process NAME in BUFFER, running PROGRAM. 700 "Make a Comint process NAME in BUFFER, running PROGRAM.
701If BUFFER is nil, it defaults to NAME surrounded by `*'s. 701If BUFFER is nil, it defaults to NAME surrounded by `*'s.
702PROGRAM should be either a string denoting an executable program to create 702If there is a running process in BUFFER, it is not restarted.
703via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting 703
704a TCP connection to be opened via `open-network-stream'. If there is already 704PROGRAM should be one of the following:
705a running process in that buffer, it is not restarted. Optional fourth arg 705- a string, denoting an executable program to create via
706STARTFILE is the name of a file, whose contents are sent to the 706 `start-file-process'
707process as its initial input. 707- a cons pair of the form (HOST . SERVICE), denoting a TCP
708 connection to be opened via `open-network-stream'
709- nil, denoting a newly-allocated pty.
710
711Optional fourth arg STARTFILE is the name of a file, whose
712contents are sent to the process as its initial input.
708 713
709If PROGRAM is a string, any more args are arguments to PROGRAM. 714If PROGRAM is a string, any more args are arguments to PROGRAM.
710 715
711Returns the (possibly newly created) process buffer." 716Return the (possibly newly created) process buffer."
712 (or (fboundp 'start-file-process) 717 (or (fboundp 'start-file-process)
713 (error "Multi-processing is not supported for this system")) 718 (error "Multi-processing is not supported for this system"))
714 (setq buffer (get-buffer-create (or buffer (concat "*" name "*")))) 719 (setq buffer (get-buffer-create (or buffer (concat "*" name "*"))))
@@ -752,9 +757,18 @@ See `make-comint' and `comint-exec'."
752(defun comint-exec (buffer name command startfile switches) 757(defun comint-exec (buffer name command startfile switches)
753 "Start up a process named NAME in buffer BUFFER for Comint modes. 758 "Start up a process named NAME in buffer BUFFER for Comint modes.
754Runs the given COMMAND with SWITCHES, and initial input from STARTFILE. 759Runs the given COMMAND with SWITCHES, and initial input from STARTFILE.
755Blasts any old process running in the buffer. Doesn't set the buffer mode. 760
756You can use this to cheaply run a series of processes in the same Comint 761COMMAND should be one of the following:
757buffer. The hook `comint-exec-hook' is run after each exec." 762- a string, denoting an executable program to create via
763 `start-file-process'
764- a cons pair of the form (HOST . SERVICE), denoting a TCP
765 connection to be opened via `open-network-stream'
766- nil, denoting a newly-allocated pty.
767
768This function blasts any old process running in the buffer, and
769does not set the buffer mode. You can use this to cheaply run a
770series of processes in the same Comint buffer. The hook
771`comint-exec-hook' is run after each exec."
758 (with-current-buffer buffer 772 (with-current-buffer buffer
759 (let ((proc (get-buffer-process buffer))) ; Blast any old process. 773 (let ((proc (get-buffer-process buffer))) ; Blast any old process.
760 (if proc (delete-process proc))) 774 (if proc (delete-process proc)))