breck@ganzer.ecs.umass.edu (Liam Breck) (04/27/91)
A while back I wrote to comp.windows.x: > ... the R4 xterm has menus which I can barely see and meta-<key> > just dumps <key> into Emacs. Help... Here is the info from the replies I got. Special thanx to Jaap Vermeulen and Liam Quin for their extra help. Fixing menus: The menus now use geometry and other resources loaded from the .Xdefaults file. I changed/added the following entries in that file: xterm*VT100.geometry: your_favorite ! won't affect menus xterm*VT100.borderWidth: # ! won't affect menus xterm*SimpleMenu.borderColor: a_nice_color ! only affects menus Fixing meta-<key> passing: Basically all you have to do is add xmodmap -e "keysym xxx = Meta_L" to the beginning of your .xsession or .xinitrc file, where xxx is the keysym name of your meta key. xev is handy for finding this name (Alt_L in my case). R4 Xtoolkit evidently looks for a Meta_L/R modifier by default. Then it's up to your applications to set the terminal for eight bit input. Of course, you can do it yourself: stty pass8 # in the BSD world. stty cs8 -istrip # in the SysV world (may need other args) When Ultrix or rlogin is between you and your meta-seeking application (such as GNU Emacs) it's a bit more complicated. I start an xterm on Ultrix, rlogin to a SunOS node and run Emacs there. Ultrix rlogin strips the eigth bit by default, so it needs to be started with the `-8' option to pass meta-<key>. SunOS rlogin seems to pass the eighth bit without `-8', although the SunOS rlogin man page doesn't say why. To get meta-<key> when running Emacs on Ultrix in xterm (either local or remote) the terminal input mode must be changed from within Emacs: (if (string= (getenv "TERM") "xterm") (set-input-mode t nil)) in one's .emacs file. I believe (my knowledge is fuzzy here) that Emacs' default is to ask the OS for eight bits (it does this with SunOS) but I think Ultrix doesn't understand. A bug? Using the above command says: "Hey Ultrix! Yeah, you! Eight bit input NOW, dammit!" and Ultrix complies. (Further info about this bug/feature would be appreciated...) Finally, if none of the above solutions work, one can always try: xterm*VT100.Translations: #override Alt<Key>: string("0x1B") insert() in .Xdefaults. This is a kludge that makes meta-<key> generate the escape sequence <ESC><key>. I was also reminded that if you're serious about Emacs you needn't bother with xterm. GNU Emacs has X support so it can run in its own X window. In my case I *do* use emacs for X, and also occasionally want Emacs in an xterm. Comments, additions and corrections to this post welcome! -- Liam Breck breck@umvlsi.ecs.umass.edu