diff options
| author | Leo Liu | 2013-12-02 15:13:01 +0800 |
|---|---|---|
| committer | Leo Liu | 2013-12-02 15:13:01 +0800 |
| commit | 0518b057fe4e50664cb84bfb6d8ef24d81c94431 (patch) | |
| tree | 11059affb87e0cc8431456f202ae656b45eacf75 | |
| parent | 3adc9c6dca2c52aa41165f112a4e875267c6315e (diff) | |
| download | emacs-0518b057fe4e50664cb84bfb6d8ef24d81c94431.tar.gz emacs-0518b057fe4e50664cb84bfb6d8ef24d81c94431.zip | |
* subr.el (process-live-p): Return nil for non-process.
* progmodes/sh-script.el (sh-shell-process):
* progmodes/octave.el (inferior-octave-process-live-p):
* progmodes/gdb-mi.el (gdb-delchar-or-quit)
(gdb-inferior-io-sentinel):
* emacs-lock.el (emacs-lock-live-process-p): All uses changed.
Fixes: debbugs:16023
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/emacs-lock.el | 3 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 8 | ||||
| -rw-r--r-- | lisp/progmodes/octave.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 2 | ||||
| -rw-r--r-- | lisp/subr.el | 8 |
6 files changed, 22 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b943b3c5fa8..df576658697 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2013-12-02 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * subr.el (process-live-p): Return nil for non-process. (Bug#16023) | ||
| 4 | |||
| 5 | * progmodes/sh-script.el (sh-shell-process): | ||
| 6 | * progmodes/octave.el (inferior-octave-process-live-p): | ||
| 7 | * progmodes/gdb-mi.el (gdb-delchar-or-quit) | ||
| 8 | (gdb-inferior-io-sentinel): | ||
| 9 | * emacs-lock.el (emacs-lock-live-process-p): All uses changed. | ||
| 10 | |||
| 1 | 2013-12-02 Dmitry Gutov <dgutov@yandex.ru> | 11 | 2013-12-02 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 12 | ||
| 3 | * vc/log-edit.el (log-edit-kill-buffer): Move the use of | 13 | * vc/log-edit.el (log-edit-kill-buffer): Move the use of |
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el index ac12c149b01..f1fa9316c82 100644 --- a/lisp/emacs-lock.el +++ b/lisp/emacs-lock.el | |||
| @@ -109,8 +109,7 @@ Internal use only.") | |||
| 109 | 109 | ||
| 110 | (defun emacs-lock-live-process-p (buffer-or-name) | 110 | (defun emacs-lock-live-process-p (buffer-or-name) |
| 111 | "Return t if BUFFER-OR-NAME is associated with a live process." | 111 | "Return t if BUFFER-OR-NAME is associated with a live process." |
| 112 | (let ((proc (get-buffer-process buffer-or-name))) | 112 | (process-live-p (get-buffer-process buffer-or-name))) |
| 113 | (and proc (process-live-p proc)))) | ||
| 114 | 113 | ||
| 115 | (defun emacs-lock--can-auto-unlock (action) | 114 | (defun emacs-lock--can-auto-unlock (action) |
| 116 | "Return t if the current buffer can auto-unlock for ACTION. | 115 | "Return t if the current buffer can auto-unlock for ACTION. |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 4b0a012e538..224def85895 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -981,7 +981,8 @@ no input, and GDB is waiting for input." | |||
| 981 | (eq gud-minor-mode 'gdbmi)) | 981 | (eq gud-minor-mode 'gdbmi)) |
| 982 | (error "Not in a GDB-MI buffer")) | 982 | (error "Not in a GDB-MI buffer")) |
| 983 | (let ((proc (get-buffer-process gud-comint-buffer))) | 983 | (let ((proc (get-buffer-process gud-comint-buffer))) |
| 984 | (if (and (eobp) proc (process-live-p proc) | 984 | (if (and (eobp) |
| 985 | (process-live-p proc) | ||
| 985 | (not gud-running) | 986 | (not gud-running) |
| 986 | (= (point) (marker-position (process-mark proc)))) | 987 | (= (point) (marker-position (process-mark proc)))) |
| 987 | ;; Sending an EOF does not work with GDB-MI; submit an | 988 | ;; Sending an EOF does not work with GDB-MI; submit an |
| @@ -1584,9 +1585,8 @@ this trigger is subscribed to `gdb-buf-publisher' and called with | |||
| 1584 | ;; read from the pty, and stops listening to it. If the gdb | 1585 | ;; read from the pty, and stops listening to it. If the gdb |
| 1585 | ;; process is still running, remove the pty, make a new one, and | 1586 | ;; process is still running, remove the pty, make a new one, and |
| 1586 | ;; pass it to gdb. | 1587 | ;; pass it to gdb. |
| 1587 | (let ((gdb-proc (get-buffer-process gud-comint-buffer)) | 1588 | (let ((io-buffer (process-buffer proc))) |
| 1588 | (io-buffer (process-buffer proc))) | 1589 | (when (and (process-live-p (get-buffer-process gud-comint-buffer)) |
| 1589 | (when (and gdb-proc (process-live-p gdb-proc) | ||
| 1590 | (buffer-live-p io-buffer)) | 1590 | (buffer-live-p io-buffer)) |
| 1591 | ;; `comint-exec' deletes the original process as a side effect. | 1591 | ;; `comint-exec' deletes the original process as a side effect. |
| 1592 | (comint-exec io-buffer "gdb-inferior" nil nil nil) | 1592 | (comint-exec io-buffer "gdb-inferior" nil nil nil) |
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 5e79e6627d8..7b9d7c97f85 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el | |||
| @@ -700,7 +700,7 @@ in the Inferior Octave buffer.") | |||
| 700 | (declare-function compilation-forget-errors "compile" ()) | 700 | (declare-function compilation-forget-errors "compile" ()) |
| 701 | 701 | ||
| 702 | (defun inferior-octave-process-live-p () | 702 | (defun inferior-octave-process-live-p () |
| 703 | (and inferior-octave-process (process-live-p inferior-octave-process))) | 703 | (process-live-p inferior-octave-process)) |
| 704 | 704 | ||
| 705 | (define-derived-mode inferior-octave-mode comint-mode "Inferior Octave" | 705 | (define-derived-mode inferior-octave-mode comint-mode "Inferior Octave" |
| 706 | "Major mode for interacting with an inferior Octave process." | 706 | "Major mode for interacting with an inferior Octave process." |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 3ac0868414b..c270d433e76 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1478,7 +1478,7 @@ frequently editing existing scripts with different styles.") | |||
| 1478 | (defun sh-shell-process (force) | 1478 | (defun sh-shell-process (force) |
| 1479 | "Get a shell process for interaction. | 1479 | "Get a shell process for interaction. |
| 1480 | If FORCE is non-nil and no process found, create one." | 1480 | If FORCE is non-nil and no process found, create one." |
| 1481 | (if (and sh-shell-process (process-live-p sh-shell-process)) | 1481 | (if (process-live-p sh-shell-process) |
| 1482 | sh-shell-process | 1482 | sh-shell-process |
| 1483 | (setq sh-shell-process | 1483 | (setq sh-shell-process |
| 1484 | (let ((found nil) proc | 1484 | (let ((found nil) proc |
diff --git a/lisp/subr.el b/lisp/subr.el index b22c719f010..6b1e99f337c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1885,9 +1885,11 @@ Signal an error if the program returns with a non-zero exit status." | |||
| 1885 | (defun process-live-p (process) | 1885 | (defun process-live-p (process) |
| 1886 | "Returns non-nil if PROCESS is alive. | 1886 | "Returns non-nil if PROCESS is alive. |
| 1887 | A process is considered alive if its status is `run', `open', | 1887 | A process is considered alive if its status is `run', `open', |
| 1888 | `listen', `connect' or `stop'." | 1888 | `listen', `connect' or `stop'. Value is nil if PROCESS is not a |
| 1889 | (memq (process-status process) | 1889 | process." |
| 1890 | '(run open listen connect stop))) | 1890 | (and (processp process) |
| 1891 | (memq (process-status process) | ||
| 1892 | '(run open listen connect stop)))) | ||
| 1891 | 1893 | ||
| 1892 | ;; compatibility | 1894 | ;; compatibility |
| 1893 | 1895 | ||