On Thu, Nov 06, 2003 at 11:48:36AM +0900, Stephen J. Turnbull wrote:
 This sounds like a job for ... Specifierman!
 
 Except that there's no 'ssh-d-into-a-net-slow-box display type.
 
 It sounds like something that would be worth taking a hack at.  What
 kind of API do you need?  Ie, suppose there were a variable
 `gnuclient-environmental-conditions'.  What kinds of questions would
 you want to ask it, and what kinds of answers do you want in what
 conditions? 
Doesn't having gnuclient pass it's process id, hostname, $DISPLAY value and
tty to xemacs give enough info? Then, the gnuserv side could do something
like:
    if client has usable DISPLAY {
	if (gnuserv-frame 'x) {
	    if client DISPLAY == server DISPLAY {
		use server's gnuserv frame
	    }
	    else {
		create new frame on client DISPLAY and use that
	    }
	}
	else {
	    create new frame on client DISPLAY and use that
	}
    }
    ;; Creating new frame on client DISPLAY could have failed due to xauth,
    ;; xhost, etc.
    if new frame creation failed OR client has no usable DISPLAY {
	if xemacs & gnuclient are running on the same host AND
	   xemacs process is an ancestor of gnuclient,
	then use the "current frame"
	else take over client's tty and use that
    }
    if all that failed, then can't do the gnuclient;
Does that cover all the bases?
 Or maybe gnuclient should somehow intervene in the environment that
 getenv sees?  (That's too evil to actually implement I suspect, but it
 might suggest something more appropriate.)  Maybe there could be a
 display-local environment process environment? 
??
Scott