How to tell emacs what to do when it receives a Delete or Backspace
Put in your .emacs file lines like
Of course you can bind other commands to other keys in the same way. Note that various major and minor modes redefine keybindings. For example, in incremental search mode one finds the code(global-set-key "\?" 'help-command)
(global-set-key "\C-h" 'delete-backward-char)
This means that it may be a bad idea to use the above two global-set-key commands. There are too many places where there are built-in assumptions about Ctrl-H = help and DEL = delete. That doesn't mean that you have to setup keys so that Backspace generates DEL. But if it doesn't then it is easiest to remap them at the lowest possible level in emacs.(define-key map "\177" 'isearch-delete-char)
(define-key map "\C-h" 'isearch-mode-help)
http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-5.html
Below is to redefine keys.
http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/developers-handbook/emacs.html
http://www-rcf.usc.edu/~christoj/.emacs
No comments:
Post a Comment