Path: utzoo!utgpu!water!watmath!clyde!ima!think!sharakan From: sharakan@think.COM (Eric Sharakan) Newsgroups: comp.emacs Subject: Re: Setting terminal-emulator's environment Keywords: GNU Emacs function `terminal-emulator' Message-ID: <13995@think.UUCP> Date: 19 Dec 87 00:47:52 GMT References: <261@bernina.UUCP> Sender: usenet@think.UUCP Lines: 46 In article <261@bernina.UUCP> heiser@ethz.UUCP (Gernot Heiser) writes: Using the GNU emacs terminal-emulator to run interactive programs would be quite limited if the parent emacs can't be used for editing (when the program run under the emulator starts up an editor). While some programs (like `rn') allow to explicitely specify the editor, a general solution would require to specify `emacsclient' in the `EDITOR' environment variable of the process running under the terminal emulator. Naturally this could be done by running the shell under the emulator, setting the environment of the shell, and then running the program we are really interested in. A better way would be to set the environment from the `terminal-mode-hook'. Is there any means to achieve this???? (I'm running GNU >Emacs version 18.49.) The te-stuff-string function within the terminal emulator can be used to send any string to the program (presumably shell) running in the emulator. I use this to do some stty setting as follows: (setq terminal-mode-hook '(lambda () (setq terminal-scrolling t) (setq terminal-escape-char 27) (te-stuff-string "stty crtbs crterase crtkill ctlecho "))) The last form does the same thing as if I had typed 'stty crtbs crterase ...' at the prompt in the terminal emulator. Simply replace that string with "setenv EDITOR emacsclient<^J>" and you should be all set. BTW, the other two forms within my terminal-mode-hook do the following: - Set the terminal to scroll (as opposed to wrapping) when the bottom of the terminal window is reached. - Set the terminal escape character to . I don't like the default value of CTL-^. ---- Eric Sharakan, Thinking Machines Corporation, Cambridge, Ma., 02142 sharakan@think.COM ihnp4!think!sharakan (617) 876-1111