diff options
| author | Chong Yidong | 2012-04-19 16:09:30 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-04-19 16:09:30 +0800 |
| commit | b668fa6eb0d46a8f3c675954dfd8ce79e6441129 (patch) | |
| tree | 3ecf93953301ce744455f7eaa79d2b18d8c3a631 /lisp/comint.el | |
| parent | c5467d73aea190e3712f1e146c326ad2d94ed0bb (diff) | |
| download | emacs-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.el | 34 |
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. |
| 701 | If BUFFER is nil, it defaults to NAME surrounded by `*'s. | 701 | If BUFFER is nil, it defaults to NAME surrounded by `*'s. |
| 702 | PROGRAM should be either a string denoting an executable program to create | 702 | If there is a running process in BUFFER, it is not restarted. |
| 703 | via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting | 703 | |
| 704 | a TCP connection to be opened via `open-network-stream'. If there is already | 704 | PROGRAM should be one of the following: |
| 705 | a running process in that buffer, it is not restarted. Optional fourth arg | 705 | - a string, denoting an executable program to create via |
| 706 | STARTFILE is the name of a file, whose contents are sent to the | 706 | `start-file-process' |
| 707 | process 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 | |||
| 711 | Optional fourth arg STARTFILE is the name of a file, whose | ||
| 712 | contents are sent to the process as its initial input. | ||
| 708 | 713 | ||
| 709 | If PROGRAM is a string, any more args are arguments to PROGRAM. | 714 | If PROGRAM is a string, any more args are arguments to PROGRAM. |
| 710 | 715 | ||
| 711 | Returns the (possibly newly created) process buffer." | 716 | Return 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. |
| 754 | Runs the given COMMAND with SWITCHES, and initial input from STARTFILE. | 759 | Runs the given COMMAND with SWITCHES, and initial input from STARTFILE. |
| 755 | Blasts any old process running in the buffer. Doesn't set the buffer mode. | 760 | |
| 756 | You can use this to cheaply run a series of processes in the same Comint | 761 | COMMAND should be one of the following: |
| 757 | buffer. 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 | |||
| 768 | This function blasts any old process running in the buffer, and | ||
| 769 | does not set the buffer mode. You can use this to cheaply run a | ||
| 770 | series 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))) |