summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2011-05-31 20:40:00 +0200
committerLars Magne Ingebrigtsen <larsi@gnus.org>2011-05-31 20:40:00 +0200
commitbcd54f837039f8d28e0bb8320385ca2dc6fdd5d3 (patch)
treea569ae614a24267c168d788c9df97334cc653ba0 /lisp/subr.el
parent864db017b0b040e386f95b21c2501e1a71d86318 (diff)
downloademacs-bcd54f837039f8d28e0bb8320385ca2dc6fdd5d3.tar.gz
Add the tiny convenience function `process-alive-p'.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 4fe9987b95b..08099dc1fdd 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1805,6 +1805,13 @@ Signal an error if the program returns with a non-zero exit status."
(forward-line 1))
(nreverse lines)))))
+(defun process-alive-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)))
+
;; compatibility
(make-obsolete