[gnu.emacs] How do I know if I am in Emacstool

janssen@titan.sw.mcc.com (Bill Janssen) (03/12/89)

In article <37031@bbn.COM>, mesard@bbn (Wayne Mesard) writes:
>(Why
>doesn't emacstool set an env variable or somfin?!)

Indeed.

I've been trying to write a set of functions which work both in Emacstool
and in X (and with luck, on any other windowing port of GNU Emacs), but
that symbol "window-system" doesn't get set on Emacstool (which it should).
Having Emacstool set an environment variable would be one way to do it;
passing the window system type directly to Emacs would probably work better,
to avoid having the environment variable inherited by any subprocesses.

Bill

peck@SUN.COM (03/14/89)

 The next release of emacstool will contain these three lines
near the beginning of main in emacstool.c
This provides a enviroment variable to inform subprocesses that
the input is being filtered through emacstool, and informs the 
inner process that the emacstool window is indeed a "TERM=sun"
window (in case you started it in NeWS or sun-cmd or whatever)

Those who care may try this out even now, if you have better suggestions,
i'll consider them, too.  [send to peck@sun.com, not the whole net]

  putenv("IN_EMACSTOOL=t");	/* notify subprocess that it is in emacstool */
  putenv("TERMCAP=");
  putenv("TERM=sun");		/* the TTYSW will be a sun terminal 
				 * to override these, try % emacstool -rc script
				 */
  
Also, in .../lisp/term/sun.el add the last lines:

;;; If Emacstool is being nice, and informs us of its presence:
(if (getenv "IN_EMACSTOOL") (emacstool-init))

janssen@titan.sw.mcc.com (Bill Janssen) (03/17/89)

lisp/term/sun.el should also set the window-system variable to "emacstool"
or "sunview".

Bill