Emacs term def -- Message Summary

leo at aai.com leo at aai.com
Fri May 3 07:16:58 AEST 1991


geoff at vax1.mankato.msus.edu writes:

>(MESSAGE SUMMARY) topic: Emacs AT386 keyboard definition files
>In addition, I have found a nice little tip recently.  Put this in your 
>.emacs file:

>	(global-unset-key "\C-h")
>	(global-set-key "\C-h" 'delete-backward-char)
>	(global-unset-key "\M-/");
>	(global-set-key "\M-/" 'help-for-help)

>It maked the backspace work like a backspace key should work, rather than
>calling up the help menu.  To bring up help, press M-/ (a.k.a. Alt-?).  The
>DEL key is unchanged-- I never did figure out how to make it behave like a
>DEL key...

This is not the best way to swap the keys because they will not be swapped
in all cases.  Emacs uses different keymaps for certain modes and buffers.
For the delete and backspace keys to ALWAYS be swapped, use the following:

(let ((the-table (make-string 128 0)))
  (let ((i 0))
    (while (< i 128)
      (aset the-table i i)
      (setq i (1+ i))))
  ;; Swap ^H and DEL
  (aset the-table ?\177 ?\^h)
  (aset the-table ?\^h ?\177)
  (setq keyboard-translate-table the-table))

If you like, you can also swap the escape and backtick key if the escape
isn't next to the '1' key where GOD intended it to be, by adding:

    (aset the-table ?\e ?`)
    (aset the-table ?` ?\e)

just above the
  (setq keyboard-translate-table the-table))
above.

You can add this function to your .emacs file.
-- 
Leo	leo at aai.com   leo%aai at uunet.uu.net   ...uunet!aai!leo



More information about the Comp.unix.sysv386 mailing list