[gnu.emacs] transposing C-h & DEL

sanderso@umn-cs.CS.UMN.EDU (Steven Anderson) (07/19/89)

How could you switch the functions of control-h and the DELETE key?  I
seem to have gotten C-h to perform backward-delete-char with the
following line added to my .emacs file:

          (define-key global-map "\C-h" 'backward-delete-char)

However, I can't get the DELETE key to act as the help prefix
character.  I don't even know how to reference the DELETE key (like
"\C-h" references control-h).  Ideas?

I am using GNU Emacs 18.52.2 on a Sun 3/something
-- 
-Steve Anderson
INTERNET: sanderso@umn-cs.cs.umn.edu           UUCP: uunet!umn-cs!sanderso
"Beware of signs that say 'hidden driveway'"--the B-52's

mdb@bridge2.ESD.3Com.COM (Mark D. Baushke) (07/19/89)

In article <14514@umn-cs.CS.UMN.EDU> sanderso@umn-cs.CS.UMN.EDU
(Steven Anderson) writes:
>
>  How could you switch the functions of control-h and the DELETE key?
>
>  I am using GNU Emacs 18.52.2 on a Sun 3/something
>  -- 
>  -Steve Anderson
>  INTERNET: sanderso@umn-cs.cs.umn.edu           UUCP: uunet!umn-cs!sanderso
>  "Beware of signs that say 'hidden driveway'"--the B-52's

You might find the following function useful:

(defun swap-ctl-h-and-del ()
  "Swap the C-h and C-? keys."
  (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 ?\C-? ?\C-h)
  (aset keyboard-translate-table ?\C-h ?\C-?)
)

Enjoy!
--
Mark D. Baushke
UUCP:	    {3comvax,auspex,sun}!bridge2!mdb
Internet:   mdb@bridge2.ESD.3Com.COM