From 9c01e545492a36ebed15c2e1706623cc704889e6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 4 Nov 2001 02:03:05 +0000 Subject: [PATCH] (function-key-map): Add entry for `ESC [ 3 ~' -> Add entries `ESC O 5 [ABCD]' -> C-{up,down,right,left}. Use inheritance so that .emacs and terminfo take precedence. --- lisp/ChangeLog | 7 ++++++ lisp/term/xterm.el | 56 +++++++++++++++++++++++++++++----------------- 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 81557dc634c..766ec3dad58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2001-11-03 Stefan Monnier + + * term/xterm.el (function-key-map): + Add entry for `ESC [ 3 ~' -> + Add entries `ESC O 5 [ABCD]' -> C-{up,down,right,left}. + Use inheritance so that .emacs and terminfo take precedence. + 2001-11-03 Eli Zaretskii * tooltip.el (tooltip-delay): Decrease to 0.7. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 6f0f779df49..b04f0396134 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -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 -- 2.39.5