changeset 40694:41fcf9864c4d

(function-key-map): Add entry for `ESC [ 3 ~' -> <delete> Add entries `ESC O 5 [ABCD]' -> C-{up,down,right,left}. Use inheritance so that .emacs and terminfo take precedence.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 04 Nov 2001 02:02:50 +0000
parents 80ba762c0205
children 70a8c046356e
files lisp/term/xterm.el
diffstat 1 files changed, 35 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/xterm.el	Sat Nov 03 23:53:10 2001 +0000
+++ b/lisp/term/xterm.el	Sun Nov 04 02:02:50 2001 +0000
@@ -26,26 +26,40 @@
 
 ;;; Code:
 
-(define-key function-key-map "\e[A" [up])
-(define-key function-key-map "\e[B" [down])
-(define-key function-key-map "\e[C" [right])
-(define-key function-key-map "\e[D" [left])
-(define-key function-key-map "\e[2~" [insert])
-(define-key function-key-map "\e[4~" [select])
-(define-key function-key-map "\e[5~" [prior])
-(define-key function-key-map "\e[6~" [next])
-(define-key function-key-map "\e[11~" [f1])
-(define-key function-key-map "\e[12~" [f2])
-(define-key function-key-map "\e[13~" [f3])
-(define-key function-key-map "\e[14~" [f4])
-(define-key function-key-map "\e[15~" [f5])
-(define-key function-key-map "\e[17~" [f6])
-(define-key function-key-map "\e[18~" [f7])
-(define-key function-key-map "\e[19~" [f8])
-(define-key function-key-map "\e[20~" [f9])
-(define-key function-key-map "\e[21~" [f10])
-(define-key function-key-map "\e[23~" [f11])
-(define-key function-key-map "\e[24~" [f12])
-(define-key function-key-map "\e[29~" [print])
+(let ((map (make-sparse-keymap)))
+  (define-key map "\e[A" [up])
+  (define-key map "\e[B" [down])
+  (define-key map "\e[C" [right])
+  (define-key map "\e[D" [left])
+  (define-key map "\e[1~" [home])
+  (define-key map "\e[2~" [insert])
+  (define-key map "\e[3~" [delete])
+  (define-key map "\e[4~" [select])
+  (define-key map "\e[5~" [prior])
+  (define-key map "\e[6~" [next])
+  (define-key map "\e[11~" [f1])
+  (define-key map "\e[12~" [f2])
+  (define-key map "\e[13~" [f3])
+  (define-key map "\e[14~" [f4])
+  (define-key map "\e[15~" [f5])
+  (define-key map "\e[17~" [f6])
+  (define-key map "\e[18~" [f7])
+  (define-key map "\e[19~" [f8])
+  (define-key map "\e[20~" [f9])
+  (define-key map "\e[21~" [f10])
+  (define-key map "\e[23~" [f11])
+  (define-key map "\e[24~" [f12])
+  (define-key map "\e[29~" [print])
+
+  (define-key map "\eO5A" [C-up])
+  (define-key map "\eO5B" [C-down])
+  (define-key map "\eO5C" [C-right])
+  (define-key map "\eO5D" [C-left])
+
+  ;; Use inheritance to let the main keymap override those defaults.
+  ;; This way we don't override terminfo-derived settings or settings
+  ;; made in the .emacs file.
+  (set-keymap-parent map (keymap-parent function-key-map))
+  (set-keymap-parent function-key-map map))
 
 ;;; xterm.el ends here