Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!rutgers!husc6!think!mit-eddie!mit-trillian!rlk From: rlk@mit-trillian.MIT.EDU (Robert L Krawitz) Newsgroups: net.emacs Subject: Re: GNU Emacs with X Windows Message-ID: <1298@mit-trillian.MIT.EDU> Date: Sun, 19-Oct-86 14:22:26 EDT Article-I.D.: mit-tril.1298 Posted: Sun Oct 19 14:22:26 1986 Date-Received: Tue, 21-Oct-86 06:35:26 EDT Reply-To: rlk@athena.MIT.EDU Organization: MIT Project Athena Lines: 35 In article <34@cartan.Berkeley.EDU> desj@brahms (David desJardins) writes: >Can someone explain how GNU Emacs handles X Windows? In particular, suppose >I run 'xinit xtools' where xtools is a program that forks off certain X >applications, including emacs. I have set DISPLAY to be 'unix:0'. > >What I really don't understand is that it *does* work if I first set TERM >to 'xterm'. Why should it matter what terminal type I am running?? I am >almost certain that emacs (quite properly) writes directly to the X window, >rather than using a terminal emulator like xterm. > >The only thing that I can think of is that it is checking my terminal type >to see if I am really running X! Is it really possible that it would do >this? This is a truly awful way to go about things, in that (among other >things) it assumes that only one particular terminal emulator will be used >from inside X. > >I suppose I will dig into the source if I have to, and see for myself what >it is doing; I am just hoping that someone who knows how it works can let >me know what is going on and save me a lot of effort. And this seems like >something that could be of interest to other people -- I'm not sure how >many people out there are really using X... > The current version of gnuemacs looks at the value of the environment variable TERM to determine whether or not to run under X. It was pointed out to me that this is not the correct way to do it; this is an artifact of an older implementation. I'll fix this as soon as I have time to do so; it's a simple fix. For those people who wish to take a look at it for themselves, the code is in emacs.c in the function main(). The code around getenv("TERM") is the part that needs to be changed. There may be one or two other places that also need to be fixed; fixing the code in emacs.c should suffice for anyone who needs to fix it temporarily. -- Robert^Z