diff options
| author | Lars Magne Ingebrigtsen | 2011-05-31 20:40:00 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2011-05-31 20:40:00 +0200 |
| commit | bcd54f837039f8d28e0bb8320385ca2dc6fdd5d3 (patch) | |
| tree | a569ae614a24267c168d788c9df97334cc653ba0 /lisp | |
| parent | 864db017b0b040e386f95b21c2501e1a71d86318 (diff) | |
| download | emacs-bcd54f837039f8d28e0bb8320385ca2dc6fdd5d3.tar.gz emacs-bcd54f837039f8d28e0bb8320385ca2dc6fdd5d3.zip | |
Add the tiny convenience function `process-alive-p'.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/subr.el | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0070f3a3945..384a30cb7cd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-05-31 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * subr.el (process-alive-p): New tiny convenience function. | ||
| 4 | |||
| 1 | 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * emacs-lisp/debug.el (debug): Save&restore not just the buffer's | 7 | * emacs-lisp/debug.el (debug): Save&restore not just the buffer's |
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." | |||
| 1805 | (forward-line 1)) | 1805 | (forward-line 1)) |
| 1806 | (nreverse lines))))) | 1806 | (nreverse lines))))) |
| 1807 | 1807 | ||
| 1808 | (defun process-alive-p (process) | ||
| 1809 | "Returns non-nil if PROCESS is alive. | ||
| 1810 | A process is considered alive if its status is `run', `open', | ||
| 1811 | `listen', `connect' or `stop'." | ||
| 1812 | (memq (process-status process) | ||
| 1813 | '(run open listen connect stop))) | ||
| 1814 | |||
| 1808 | ;; compatibility | 1815 | ;; compatibility |
| 1809 | 1816 | ||
| 1810 | (make-obsolete | 1817 | (make-obsolete |