🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #188839

Re: rebinding backspace key in gnuemacs (on PC)

#188839
From: Tom Wicklund
Date: Tue, 11 Jun 1991 17:03
34 lines
2119 bytes
In <PETRILLI.91Jun6192752@geech.gnu.ai.mit.edu> petrilli@geech.gnu.ai.mit.edu (Chris Petrilli) writes:

>I have the same problem with the HP 9000/370s I use...   Below is the
>file 'swap-del-and-backspace.el' that will do exactly what you want.

>--- CUT HERE ---
>(defun swap-del-and-ctrl-h-key ()
>  "swaps the functions attached to backspace (C-h) and delete (C-?)."
>  (interactive)
>  (setq temporary-ctrl-h-key-binding (key-binding "\^h"))
>  (global-set-key "\^h" (key-binding "\^?"))
>  (global-set-key "\^?" temporary-ctrl-h-key-binding))

>;; (key-binding "\^h")
>;; (key-binding "\^?")
>--- CUT HERE ---


Unfortunately, the above just changes the key binding when editing
text.  It does not change the binking in various other modes (for
instance, inside incremental search DEL backs up 1 match).  The
problem is trying to find all occurrences of DEL and changing them to
\C-h.  What's really needed is a method which can change ALL bindings
of DEL to \C-h, but this probably requires an extra level of key
translation or rewriting the other key binding to work off the current
map (e.g. have incremental search bind to the "current
delete-backward-char" key.


I've sort of solved the same problem on a PC based X server by
redefining the PC keymap within the server, but this still has some
funny results.  You also need to then redefine how xterm and the shell
deal with these characters, while still putting up with some funny
goings on.
Technical Details
Message-ID: <1991Jun11.170307.29707@intellistor.com>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!news.funet.fi!sunic!uupsi!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!arrayb!wicklund
References: <8943@drutx.ATT.COM> <PETRILLI.91Jun6192752@geech.gnu.ai.mit.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,13b328a7ef271661
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-06-16 15:46:36 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!news.funet.fi!sunic!uupsi!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!arrayb!wicklund
From: wicklund@intellistor.com (Tom Wicklund)
Newsgroups: gnu.emacs.help
Subject: Re: rebinding backspace key in gnuemacs (on PC)
Message-ID: <1991Jun11.170307.29707@intellistor.com>
Date: 11 Jun 91 17:03:07 GMT
References: <8943@drutx.ATT.COM> <PETRILLI.91Jun6192752@geech.gnu.ai.mit.edu>
Organization: Intellistor
Lines: 34