]> code.delx.au - gnu-emacs/commitdiff
Make process-running-child-p return foreground process group ID
authorDaniel Colascione <dancol@dancol.org>
Tue, 24 Mar 2015 17:23:14 +0000 (10:23 -0700)
committerDaniel Colascione <dancol@dancol.org>
Tue, 24 Mar 2015 17:23:24 +0000 (10:23 -0700)
* etc/NEWS: Mention change to `process-running-child-p`.

* src/process.c (Fprocess_running_child_p): Return number identifier of
the foreground process group if we know it.

etc/ChangeLog
etc/NEWS
src/ChangeLog
src/process.c

index e146f786f6fd6275fd2b19e10612a32907d252bc..d6b6e2991132fbb74435938be4b181ff6b809398 100644 (file)
@@ -1,3 +1,7 @@
+2015-03-24  Daniel Colascione  <dancol@dancol.org>
+
+       * NEWS: Mention change to `process-running-child-p`.
+
 2015-03-23  Daiki Ueno  <ueno@gnu.org>
 
        * NEWS: Mention `make-process'.
index a8b8c55a50a4b7cf5595ee469b286c2a8d6314b2..cb319340678080d1c4e4680295f35786489c3169 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -628,6 +628,9 @@ active region handling.
 
 ** `cl-the' now asserts that its argument is of the given type.
 
+** `process-running-child-p` may now return a numeric process
+group ID instead of `t'.
+
 +++
 ** Mouse click events on mode line or header line no longer include
 any reference to a buffer position.  The 6th member of the mouse
index 99b7ec731feda2666c822f1e184870c677445a8c..815c117308b25488b5985aec95809d95b36a1751 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-24  Daniel Colascione  <dancol@dancol.org>
+
+       * process.c (Fprocess_running_child_p): Return number identifier of
+       the foreground process group if we know it.
+
 2015-03-23  Paul Eggert  <eggert@cs.ucla.edu>
 
        Minor refactoring of new Fmake_process code
index dd61f3008de445b99609ab8d36bd095f1a7ec646..3fe8644b48aa9aa17d4b742770dbcb6c47312f38 100644 (file)
@@ -5739,9 +5739,10 @@ emacs_get_tty_pgrp (struct Lisp_Process *p)
 
 DEFUN ("process-running-child-p", Fprocess_running_child_p,
        Sprocess_running_child_p, 0, 1, 0,
-       doc: /* Return t if PROCESS has given the terminal to a child.
-If the operating system does not make it possible to find out,
-return t unconditionally.  */)
+       doc: /* Return non-nil if PROCESS has given the terminal to a
+child.  If the operating system does not make it possible to find out,
+return t.  If we can find out, return the numeric ID of the foreground
+process group.  */)
   (Lisp_Object process)
 {
   /* Initialize in case ioctl doesn't exist or gives an error,
@@ -5764,6 +5765,8 @@ return t unconditionally.  */)
 
   if (gid == p->pid)
     return Qnil;
+  if (gid != -1)
+    return make_number (gid);
   return Qt;
 }
 \f