Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!wucs1!wugate!wupost!kuhub.cc.ukans.edu!huxtable From: huxtable@kuhub.cc.ukans.edu (Kathryn Huxtable) Newsgroups: gnu.emacs Subject: Re: Anything You Can Do, I Can Do "Meta" Message-ID: <5122@kuhub.cc.ukans.edu> Date: 14 Apr 89 15:07:07 GMT References: <49058@aero.ARPA> Distribution: usa Organization: University of Kansas Academic Computing Services Lines: 46 I tried mailing this directly, but it bounced. So I'm posting. In article <49058@aero.ARPA>, srt@aero.ARPA (Scott "CBS" Turner) writes: > Is there any way in Gnu Emacs to switch the bindings of these two keys > so that hitting the single quote key becomes *exactly the same* as > hitting the (normal) ESC key and the ESC key becomes the single quote > key? Binding esc-map to the single quote seems to work, but getting > ESC to insert a single quote seems to be beyond my abilities. > > I'd prefer something that works in all modes, needless to say. It > seems as if Gnu Emacs should have some kind of initial key mapping - > ie., ascii codes to key names, but if it does I don't know about it. > It's somewhere in the documentation. Here is the stuff I use: (defun lk201 () "Set stuff so we can use an lk201 keyboard in a rational way." (interactive) ;; First make a translate table that does the identity translation. (setq keyboard-translate-table (make-string 128 0)) (let ((i 0)) (while (< i 128) (aset keyboard-translate-table i i) (setq i (1+ i)))) ;; Now alter translations of some characters. (aset keyboard-translate-table ?\` ?\^[) (aset keyboard-translate-table ?\^[ ?\`) ) The DEC LK201 keyboard (standard with VT200 and VT300 series terminals) has a grave accent where the escape should be. I have to type CTRL/[ to get an escape. So I swapped the meanings in the translate table. The translate table is nil by default. When it's nil, no translation is done, otherwise all keyboard input is mapped through the table. You could even remap XON/XOFF if these bother you. Have fun! -Kathryn Huxtable huxtable@kuhub.cc.ukans.edu