From xemacs-m  Wed Feb 12 20:06:20 1997
Received: from jagor.srce.hr (root@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id UAA17649
	for <xemacs-beta@xemacs.org>; Wed, 12 Feb 1997 20:06:18 -0600 (CST)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id CAA25899; Thu, 13 Feb 1997 02:01:45 +0100 (MET)
Sender: hniksic@public.srce.hr
To: xemacs-beta@xemacs.org
Subject: Re: fixing gnuattach
References: <yvt7mkdef0r.fsf@corona.pixar.com>
X-URL: ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/
X-Attribution: Hrv
X-Face: &}4JQk=L;e.~x+|eo]#DGk@x3~ed!.~lZ}YQcYb7f[WL9L'Z*+OyA\nAEL1M(".[qvI#a2E
 6WYI5>>e7'@_)3Ol9p|Nn2wNa/;~06jL*B%tTcn/XvhAu7qeES0\|MF%$;sI#yn1+y"
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 13 Feb 1997 02:01:35 +0100
In-Reply-To: Hunter Kelly's message of 12 Feb 1997 16:16:52 -0800
Message-ID: <kigbu9pfrin.fsf@jagor.srce.hr>
Lines: 39
X-Mailer: Gnus v5.4.12/XEmacs 19.14

Hunter Kelly <retnuh@corona.pixar.com> writes:

> I propose a change such that:  tty devices (possibly others, too?)
> keep track of the process controlling it.  Then, Fsuspend_emacs can
> check the current_frame, see if is a tty, and check the controlling
> pid of the tty.  If it the same as emacs-pid, then suspend emacs, as
> it usually does.  But if it isn't the same as emacs-pid, send SIGSTOP
> (or whatever the appropriate signal is) to the controlling process.

Your reasoning sounds quite valid to me.

> If the above is better done a level above suspend_emacs, that is fine
> with me.  Maybe have and suspend_or_iconify_emacs_or_gnuattach or
> whatever.  I am just looking for consensus on whether we should
> suspend emacs or the gnuattach process.

gnuattach, definitely.  Although, you are probably right about the
level above, too (there's no need to change the name of the function).
I think that the checks from the above paragraph should be in
`suspend-or-iconify-emacs', which should check whether to call
`iconify-emacs' (if the current frame is on a window system),
`suspend-emacs' (if the current frame is a tty frame controled by an
Emacs process), or `suspend-controling-process' (if the current frame
is a tty frame controlled by an external process).

As a related issue, how about trying to implement more frames on one
tty?  I don't think that's hard at all -- I tried removing the check:

  if (!NILP (DEVICE_FRAME_LIST (d)))
    error ("Only one frame allowed on TTY devices");

in frame-tty.c, and the resulting behaviour was astonishinglyu close
to what we want to have.  E.g. the multiple-frame stuff practically
worked, only you had to press C-l after `C-x 5 o', etc.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Psychos _do not_ explode when sunlight hits them."

