emacs-devel
[Top][All Lists]
Advanced

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

Re: EMACS_GET_TTY_PGRP vs. emacs_get_tty_pgrp


From: Ken Brown
Subject: Re: EMACS_GET_TTY_PGRP vs. emacs_get_tty_pgrp
Date: Wed, 20 Oct 2010 17:28:07 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

On 10/20/2010 4:28 PM, Dan Nicolaescu wrote:
Ken Brown<address@hidden>  writes:

On 10/20/2010 2:59 PM, Dan Nicolaescu wrote:
Ken Brown<address@hidden>   writes:

The macro EMACS_GET_TTY_PGRP defined in src/systty.h uses either
tcgetpgrp or TIOCGPGRP to get the PGID of a terminal's foreground

It does not:

#ifndef DOS_NT
#define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp ((fd)))
#define EMACS_SET_TTY_PGRP(fd, pgid) (tcsetpgrp ((fd), *(pgid)))
#endif /* not DOS_NT */

also, I have a patch to remove this, it's only used in two places, so
it's not very useful as an abstraction.

Oops.  I looked at the emacs-23 branch but not the trunk.  Sorry for
the confusion.

But then I still think emacs_get_tty_pgrp in process.c should be
changed so that it works on systems that have tcgetpgrp but not
TIOCGPGRP.  How would you recommend handling this?  Is it necessary to
use conditional code as in the emacs-23 definition of
EMACS_GET_TTY_PGRP, or is it safe to just always use tcgetpgrp as in
the trunk's version of EMACS_GET_TTY_PGRP?

It think your question compounds two issues.

EMACS_GET/SET_TTY_PGRP should die, they are not useful as abstractions anymore.

The comment in emacs_get_tty_pgrp looks scary, it does not look
obvious that the code in the function can be replaced with tcgetpgrp.
Maybe it can, but, IMHO, it needs testing on a few platforms.

I think I'm just going to let this drop. I had thought I could simplify the code, but it looks like it would just get more complicated, and it's not worth the trouble.



reply via email to

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