emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 23a98c7: Make process-running-child-p return foregr


From: Daniel Colascione
Subject: [Emacs-diffs] master 23a98c7: Make process-running-child-p return foreground process group ID
Date: Tue, 24 Mar 2015 17:39:11 +0000

branch: master
commit 23a98c7a538fd6da43eba522c3db8e53c1edd1ac
Author: Daniel Colascione <address@hidden>
Commit: Daniel Colascione <address@hidden>

    Make process-running-child-p return foreground process group ID
    
    * 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 |    4 ++++
 etc/NEWS      |    3 +++
 src/ChangeLog |    5 +++++
 src/process.c |    9 ++++++---
 4 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/etc/ChangeLog b/etc/ChangeLog
index e146f78..d6b6e29 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-24  Daniel Colascione  <address@hidden>
+
+       * NEWS: Mention change to `process-running-child-p`.
+
 2015-03-23  Daiki Ueno  <address@hidden>
 
        * NEWS: Mention `make-process'.
diff --git a/etc/NEWS b/etc/NEWS
index a8b8c55..cb31934 100644
--- 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
diff --git a/src/ChangeLog b/src/ChangeLog
index 99b7ec7..815c117 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-24  Daniel Colascione  <address@hidden>
+
+       * process.c (Fprocess_running_child_p): Return number identifier of
+       the foreground process group if we know it.
+
 2015-03-23  Paul Eggert  <address@hidden>
 
        Minor refactoring of new Fmake_process code
diff --git a/src/process.c b/src/process.c
index dd61f30..3fe8644 100644
--- a/src/process.c
+++ b/src/process.c
@@ -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;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]