Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!ksr!hobbes!guy
From: guy@hobbes.ksr.com (Guy Hillyer)
Newsgroups: comp.emacs
Subject: Re: Am I using SunView or X-windows?
Message-ID: <363@ksr.UUCP>
Date: 26 Jun 88 15:44:42 GMT
References: <8806220303.AA24247@unixb.CEL.FMC.COM> <5724@columbia.edu>
Sender: nobody@ksr.UUCP
Reply-To: guy@ksr.UUCP (Guy Hillyer)
Organization: Kendall Square Research, Cambridge MA
Lines: 24

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)))

where x-startup and suntools-startup are functions that perform
window-system-specific initialization.  It's unfortunate that the
window-system variable is not set correctly when running under
suntools; I take this as further discouragment by FSF from using a
proprietary window system when you can get X for free.

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.

    	    	    	    	Guy Hillyer
    	    	    	    	Kendall Square Research Corporation
    	    	    	    	ksr!guy@harvard.harvard.edu