diff options
| author | Daniel Colascione | 2015-03-24 10:23:14 -0700 |
|---|---|---|
| committer | Daniel Colascione | 2015-03-24 10:23:24 -0700 |
| commit | 23a98c7a538fd6da43eba522c3db8e53c1edd1ac (patch) | |
| tree | 4348d5215881991d9302a7fbe8bc2ffa1576edf3 | |
| parent | 71fdbd770bf06ad48bcb165e85b59778abc9ed06 (diff) | |
| download | emacs-23a98c7a538fd6da43eba522c3db8e53c1edd1ac.tar.gz emacs-23a98c7a538fd6da43eba522c3db8e53c1edd1ac.zip | |
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.
| -rw-r--r-- | etc/ChangeLog | 4 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/process.c | 9 |
4 files changed, 18 insertions, 3 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog index e146f786f6f..d6b6e299113 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2015-03-24 Daniel Colascione <dancol@dancol.org> | ||
| 2 | |||
| 3 | * NEWS: Mention change to `process-running-child-p`. | ||
| 4 | |||
| 1 | 2015-03-23 Daiki Ueno <ueno@gnu.org> | 5 | 2015-03-23 Daiki Ueno <ueno@gnu.org> |
| 2 | 6 | ||
| 3 | * NEWS: Mention `make-process'. | 7 | * NEWS: Mention `make-process'. |
| @@ -628,6 +628,9 @@ active region handling. | |||
| 628 | 628 | ||
| 629 | ** `cl-the' now asserts that its argument is of the given type. | 629 | ** `cl-the' now asserts that its argument is of the given type. |
| 630 | 630 | ||
| 631 | ** `process-running-child-p` may now return a numeric process | ||
| 632 | group ID instead of `t'. | ||
| 633 | |||
| 631 | +++ | 634 | +++ |
| 632 | ** Mouse click events on mode line or header line no longer include | 635 | ** Mouse click events on mode line or header line no longer include |
| 633 | any reference to a buffer position. The 6th member of the mouse | 636 | any reference to a buffer position. The 6th member of the mouse |
diff --git a/src/ChangeLog b/src/ChangeLog index 99b7ec731fe..815c117308b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2015-03-24 Daniel Colascione <dancol@dancol.org> | ||
| 2 | |||
| 3 | * process.c (Fprocess_running_child_p): Return number identifier of | ||
| 4 | the foreground process group if we know it. | ||
| 5 | |||
| 1 | 2015-03-23 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2015-03-23 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Minor refactoring of new Fmake_process code | 8 | Minor refactoring of new Fmake_process code |
diff --git a/src/process.c b/src/process.c index dd61f3008de..3fe8644b48a 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5739,9 +5739,10 @@ emacs_get_tty_pgrp (struct Lisp_Process *p) | |||
| 5739 | 5739 | ||
| 5740 | DEFUN ("process-running-child-p", Fprocess_running_child_p, | 5740 | DEFUN ("process-running-child-p", Fprocess_running_child_p, |
| 5741 | Sprocess_running_child_p, 0, 1, 0, | 5741 | Sprocess_running_child_p, 0, 1, 0, |
| 5742 | doc: /* Return t if PROCESS has given the terminal to a child. | 5742 | doc: /* Return non-nil if PROCESS has given the terminal to a |
| 5743 | If the operating system does not make it possible to find out, | 5743 | child. If the operating system does not make it possible to find out, |
| 5744 | return t unconditionally. */) | 5744 | return t. If we can find out, return the numeric ID of the foreground |
| 5745 | process group. */) | ||
| 5745 | (Lisp_Object process) | 5746 | (Lisp_Object process) |
| 5746 | { | 5747 | { |
| 5747 | /* Initialize in case ioctl doesn't exist or gives an error, | 5748 | /* Initialize in case ioctl doesn't exist or gives an error, |
| @@ -5764,6 +5765,8 @@ return t unconditionally. */) | |||
| 5764 | 5765 | ||
| 5765 | if (gid == p->pid) | 5766 | if (gid == p->pid) |
| 5766 | return Qnil; | 5767 | return Qnil; |
| 5768 | if (gid != -1) | ||
| 5769 | return make_number (gid); | ||
| 5767 | return Qt; | 5770 | return Qt; |
| 5768 | } | 5771 | } |
| 5769 | 5772 | ||