Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!haven!decuac!e2big.mko.dec.com!bacchus.pa.dec.com!decwrl!sgi!shinobu!odin!eukanuba.wpd.sgi.com!mikey From: mikey@eukanuba.wpd.sgi.com (Mike Yang) Newsgroups: comp.sys.sgi Subject: Re: GNU emacs key remapping Message-ID: <11678@odin.corp.sgi.com> Date: 11 Aug 90 19:01:27 GMT References: <9008081633.AA05589@rosalyn> <3517@leah.Albany.Edu> Sender: news@odin.corp.sgi.com Reply-To: mikey@sgi.com Organization: Silicon Graphics, Inc. Lines: 48 cc: mikey In article <3517@leah.Albany.Edu>, bk7295@leah.Albany.Edu (Brian A. Kell) writes: |> I've been trying to remap things in GNU emacs to make my iris keyboard |> consistant with the vt100 terminals also used at my location. It's |> quite easy to redefine the backspace key to actually delete characters: |> (define-key global-map "\C-h" 'delete-backward-char) |> but it's much more difficult to come up with an alternate help character, |> such as the delete key (^?). This seems to be because ^h is defined |> somewhere as a special 'prefix character', similarly to ^x, ^c, esc-x, |> etc. I found that the method you describe for remapping the backspace key to be "delete" has similar problems -- some modes (e.g. rmail) have hardcoded into them "\C-h" in some way. So, to muck with the interals of gnuemacs and really swap backspace and delete, I do: ;; Set up keymap so that ^H and delete are swapped (progn (setq keyboard-translate-table (make-string 128 0)) (let ((i 0)) (while (< i 128) (aset keyboard-translate-table i i) (setq i (1+ i))))) (aset keyboard-translate-table ?\^h ?\^?) (aset keyboard-translate-table ?\^? ?\^h) This works well for gnuemacs run in xterm or wsh windows. However, it doesn't work correctly for gnuemacs X windows (i.e. gnuemacs without the -nw switch). I suspect that this is because the X server is doing something funny with the keyboard mappings, and xterm is fixing it up. It doesn't bother me because I always run gnuemacs within shells. If you don't, omit the last line from above and you'll still remap backspace to be delete. However, you won't have the help-command key bound to anything. ----------------------------------------------------------------------- Mike Yang Silicon Graphics, Inc. mikey@sgi.com 415/335-1786