+2013-12-02 Leo Liu <sdl.web@gmail.com>
+
+ * subr.el (process-live-p): Return nil for non-process. (Bug#16023)
+
+ * 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.
+
2013-12-02 Dmitry Gutov <dgutov@yandex.ru>
* vc/log-edit.el (log-edit-kill-buffer): Move the use of
(defun emacs-lock-live-process-p (buffer-or-name)
"Return t if BUFFER-OR-NAME is associated with a live process."
- (let ((proc (get-buffer-process buffer-or-name)))
- (and proc (process-live-p proc))))
+ (process-live-p (get-buffer-process buffer-or-name)))
(defun emacs-lock--can-auto-unlock (action)
"Return t if the current buffer can auto-unlock for ACTION.
(eq gud-minor-mode 'gdbmi))
(error "Not in a GDB-MI buffer"))
(let ((proc (get-buffer-process gud-comint-buffer)))
- (if (and (eobp) proc (process-live-p proc)
+ (if (and (eobp)
+ (process-live-p proc)
(not gud-running)
(= (point) (marker-position (process-mark proc))))
;; Sending an EOF does not work with GDB-MI; submit an
;; read from the pty, and stops listening to it. If the gdb
;; process is still running, remove the pty, make a new one, and
;; pass it to gdb.
- (let ((gdb-proc (get-buffer-process gud-comint-buffer))
- (io-buffer (process-buffer proc)))
- (when (and gdb-proc (process-live-p gdb-proc)
+ (let ((io-buffer (process-buffer proc)))
+ (when (and (process-live-p (get-buffer-process gud-comint-buffer))
(buffer-live-p io-buffer))
;; `comint-exec' deletes the original process as a side effect.
(comint-exec io-buffer "gdb-inferior" nil nil nil)
(declare-function compilation-forget-errors "compile" ())
(defun inferior-octave-process-live-p ()
- (and inferior-octave-process (process-live-p inferior-octave-process)))
+ (process-live-p inferior-octave-process))
(define-derived-mode inferior-octave-mode comint-mode "Inferior Octave"
"Major mode for interacting with an inferior Octave process."
(defun sh-shell-process (force)
"Get a shell process for interaction.
If FORCE is non-nil and no process found, create one."
- (if (and sh-shell-process (process-live-p sh-shell-process))
+ (if (process-live-p sh-shell-process)
sh-shell-process
(setq sh-shell-process
(let ((found nil) proc
(defun process-live-p (process)
"Returns non-nil if PROCESS is alive.
A process is considered alive if its status is `run', `open',
-`listen', `connect' or `stop'."
- (memq (process-status process)
- '(run open listen connect stop)))
+`listen', `connect' or `stop'. Value is nil if PROCESS is not a
+process."
+ (and (processp process)
+ (memq (process-status process)
+ '(run open listen connect stop))))
;; compatibility