Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cs.utexas.edu!ut-sally!ghostwheel!milano!titan!janssen
From: janssen@titan.SW.MCC.COM (Bill Janssen)
Newsgroups: comp.emacs
Subject: Re: Am I using SunView or X-windows?
Summary: detecting SunView (emacstool) properly
Message-ID: <846@titan.SW.MCC.COM>
Date: 30 Jun 88 01:49:42 GMT
References: <8806220303.AA24247@unixb.CEL.FMC.COM> <5724@columbia.edu> <363@ksr.UUCP>
Organization: MCC Software Technology
Lines: 32

In article <363@ksr.UUCP>, guy@hobbes.ksr.com (Guy Hillyer) writes:
> In article <5724@columbia.edu> agw@columbia.edu (Art Werschulz) writes:
> >I would like to be able to setq a variable to one value if my emacs
> >was called as an emacstool via SunView (a/k/a suntools) and to another
> >value if my emacs was called via X-windows.
> 
> Here's how I do it:
> 
> (cond ((equal window-system 'x) (x-startup))
>       ((getenv "WINDOW_PARENT") (suntools-startup)))
...
> In any case, the use of the WINDOW_PARENT environment variable is a
> little suspect.  It may be more appropriate to use
> WMGR_ENV_PLACEHOLDER instead.  In practice, both are present in the
> environment when a process is the child of a shelltool.

Unfortunately, I run X in overview mode over sunview, and though I can
detect the X, I can't detect the SunView, which I start from a different
X, so that DISPLAY and WINDOW_foo and WMGR_foo are all set.  GNU Emacs
doesn't know how to resolve that, either, so it can't set "window-system".
In any case, GNU Emacs running in a shelltool is not really running under
a window system.  Emacstool, however, could set an environment flag that
Emacs could pick up on, with a single line

	putenv ("EMACSTOOL=T");

before starting the emacs.  This would then give GNU Emacs something to
key off, so that it could set the "window-system" var properly.  Of course,
you can modify your local copies of emacstool.c and emacs/src/emacs.c to
do this.

Bill