[comp.emacs] DEL <-> ^H

swalton@well.UUCP (Stephen R. Walton) (11/22/86)

I would like to exchange the functionality of the backspace and delete
keys, since the former is much easier to reach than the latter on my
Tektronix 4105.  Is there an easy way to do this in GNU?  So far,
my .emacs looks like:

(define-key global-map "" 'help-command)
(global-set-key "\C-h" 'delete-backward-char)
(global-set-key "\e\C-h" 'backward-kill-word)
(global-set-key "\C-x\C-h" 'backward-kill-sentence)

(where the "" pair actually surrounds a literal delete character)
but this only does the trick in a few places.  In particular, in rmail
mode, delete still scrolls back through the current message, and there
is no way to get help.
	Thanks in advance.
				Steve Walton

evp@lewey.UUCP (11/23/86)

> 
> I would like to exchange the functionality of the backspace and delete
> keys, since the former is much easier to reach than the latter on my
> Tektronix 4105.....

The way I've been doing this is to exchange the ^H and DEL keys with the
key map (I didn't invent the trick, but it works):

; reverse ^H and RUBOUT in keymap
(setq keyboard-translate-table
      "\000\^a\^b\^c\^d\^e\^f\^g\177\^i\^j\^k\^l\^m\^n\^o\^p      <<<
\^q\^r\^s\^t\^u\^v\^w\^x\^y\^z\033\034\035\036\037\040\041\042    <<<
\043\044\045\046\047\050\051\052\053\054\055\056\0570123456789    <<<
\072\073\074\075\076\077@ABCDEFGHIJKLMNOPQRSTUVWXYZ\133\134\135   <<<
\136\137\140abcdefghijklmnopqrstuvwxyz\173\174\175\176\^h")


Note that the lines marked with <<< must be concatenated without
newlines or spaces.  This remapping causes all instances of ^H to be
replaced with DEL (and vice versa) before being mapped into commands,
so it's independent of mode.  The help key is always DEL, and the
backspace-style commands use ^H (^H = delete-backward-char, ESC-^H =
backward-kill-word, ^X-^H = backward-kill-sentence.)  A vagely
annoying side-effect is that the info and help commands don't know
about the swap and report the wrong key mappings.
---
Ed Post   {hplabs,voder,pyramid}!lewey!evp
American Information Technology
10201 Torre Ave. Cupertino CA 95014
(408)252-8713
-- 
Ed Post   {hplabs,voder,pyramid}!lewey!evp
American Information Technology
10201 Torre Ave. Cupertino CA 95014
(408)252-8713