changeset 84379:93833f201e31

(xterm-function-map): Initialize in the declaration.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 07 Sep 2007 19:47:46 +0000
parents 3c9ba55f960b
children 2fa07ee359f5
files lisp/term/xterm.el
diffstat 1 files changed, 276 insertions(+), 275 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/xterm.el	Fri Sep 07 19:46:59 2007 +0000
+++ b/lisp/term/xterm.el	Fri Sep 07 19:47:46 2007 +0000
@@ -27,300 +27,302 @@
 
 ;;; Code:
 
-(defvar xterm-function-map (make-sparse-keymap)
-  "Function key map overrides for xterm.")
+(defvar xterm-function-map
+  (let ((map (make-sparse-keymap)))
 
-;; xterm from X.org 6.8.2 uses these key definitions.
-(define-key xterm-function-map "\eOP" [f1])
-(define-key xterm-function-map "\eOQ" [f2])
-(define-key xterm-function-map "\eOR" [f3])
-(define-key xterm-function-map "\eOS" [f4])
-(define-key xterm-function-map "\e[15~" [f5])
-(define-key xterm-function-map "\e[17~" [f6])
-(define-key xterm-function-map "\e[18~" [f7])
-(define-key xterm-function-map "\e[19~" [f8])
-(define-key xterm-function-map "\e[20~" [f9])
-(define-key xterm-function-map "\e[21~" [f10])
-(define-key xterm-function-map "\e[23~" [f11])
-(define-key xterm-function-map "\e[24~" [f12])
+    ;; xterm from X.org 6.8.2 uses these key definitions.
+    (define-key map "\eOP" [f1])
+    (define-key map "\eOQ" [f2])
+    (define-key map "\eOR" [f3])
+    (define-key map "\eOS" [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 xterm-function-map "\eO2P" [S-f1])
-(define-key xterm-function-map "\eO2Q" [S-f2])
-(define-key xterm-function-map "\eO2R" [S-f3])
-(define-key xterm-function-map "\eO2S" [S-f4])
-(define-key xterm-function-map "\e[1;2P" [S-f1])
-(define-key xterm-function-map "\e[1;2Q" [S-f2])
-(define-key xterm-function-map "\e[1;2R" [S-f3])
-(define-key xterm-function-map "\e[1;2S" [S-f4])
-(define-key xterm-function-map "\e[15;2~" [S-f5])
-(define-key xterm-function-map "\e[17;2~" [S-f6])
-(define-key xterm-function-map "\e[18;2~" [S-f7])
-(define-key xterm-function-map "\e[19;2~" [S-f8])
-(define-key xterm-function-map "\e[20;2~" [S-f9])
-(define-key xterm-function-map "\e[21;2~" [S-f10])
-(define-key xterm-function-map "\e[23;2~" [S-f11])
-(define-key xterm-function-map "\e[24;2~" [S-f12])
+    (define-key map "\eO2P" [S-f1])
+    (define-key map "\eO2Q" [S-f2])
+    (define-key map "\eO2R" [S-f3])
+    (define-key map "\eO2S" [S-f4])
+    (define-key map "\e[1;2P" [S-f1])
+    (define-key map "\e[1;2Q" [S-f2])
+    (define-key map "\e[1;2R" [S-f3])
+    (define-key map "\e[1;2S" [S-f4])
+    (define-key map "\e[15;2~" [S-f5])
+    (define-key map "\e[17;2~" [S-f6])
+    (define-key map "\e[18;2~" [S-f7])
+    (define-key map "\e[19;2~" [S-f8])
+    (define-key map "\e[20;2~" [S-f9])
+    (define-key map "\e[21;2~" [S-f10])
+    (define-key map "\e[23;2~" [S-f11])
+    (define-key map "\e[24;2~" [S-f12])
 
-(define-key xterm-function-map "\eO5P" [C-f1])
-(define-key xterm-function-map "\eO5Q" [C-f2])
-(define-key xterm-function-map "\eO5R" [C-f3])
-(define-key xterm-function-map "\eO5S" [C-f4])
-(define-key xterm-function-map "\e[15;5~" [C-f5])
-(define-key xterm-function-map "\e[17;5~" [C-f6])
-(define-key xterm-function-map "\e[18;5~" [C-f7])
-(define-key xterm-function-map "\e[19;5~" [C-f8])
-(define-key xterm-function-map "\e[20;5~" [C-f9])
-(define-key xterm-function-map "\e[21;5~" [C-f10])
-(define-key xterm-function-map "\e[23;5~" [C-f11])
-(define-key xterm-function-map "\e[24;5~" [C-f12])
+    (define-key map "\eO5P" [C-f1])
+    (define-key map "\eO5Q" [C-f2])
+    (define-key map "\eO5R" [C-f3])
+    (define-key map "\eO5S" [C-f4])
+    (define-key map "\e[15;5~" [C-f5])
+    (define-key map "\e[17;5~" [C-f6])
+    (define-key map "\e[18;5~" [C-f7])
+    (define-key map "\e[19;5~" [C-f8])
+    (define-key map "\e[20;5~" [C-f9])
+    (define-key map "\e[21;5~" [C-f10])
+    (define-key map "\e[23;5~" [C-f11])
+    (define-key map "\e[24;5~" [C-f12])
 
-(define-key xterm-function-map "\eO6P" [C-S-f1])
-(define-key xterm-function-map "\eO6Q" [C-S-f2])
-(define-key xterm-function-map "\eO6R" [C-S-f3])
-(define-key xterm-function-map "\eO6S" [C-S-f4])
-(define-key xterm-function-map "\e[15;6~" [C-S-f5])
-(define-key xterm-function-map "\e[17;6~" [C-S-f6])
-(define-key xterm-function-map "\e[18;6~" [C-S-f7])
-(define-key xterm-function-map "\e[19;6~" [C-S-f8])
-(define-key xterm-function-map "\e[20;6~" [C-S-f9])
-(define-key xterm-function-map "\e[21;6~" [C-S-f10])
-(define-key xterm-function-map "\e[23;6~" [C-S-f11])
-(define-key xterm-function-map "\e[24;6~" [C-S-f12])
+    (define-key map "\eO6P" [C-S-f1])
+    (define-key map "\eO6Q" [C-S-f2])
+    (define-key map "\eO6R" [C-S-f3])
+    (define-key map "\eO6S" [C-S-f4])
+    (define-key map "\e[15;6~" [C-S-f5])
+    (define-key map "\e[17;6~" [C-S-f6])
+    (define-key map "\e[18;6~" [C-S-f7])
+    (define-key map "\e[19;6~" [C-S-f8])
+    (define-key map "\e[20;6~" [C-S-f9])
+    (define-key map "\e[21;6~" [C-S-f10])
+    (define-key map "\e[23;6~" [C-S-f11])
+    (define-key map "\e[24;6~" [C-S-f12])
 
-(define-key xterm-function-map "\eO3P" [A-f1])
-(define-key xterm-function-map "\eO3Q" [A-f2])
-(define-key xterm-function-map "\eO3R" [A-f3])
-(define-key xterm-function-map "\eO3S" [A-f4])
-(define-key xterm-function-map "\e[15;3~" [A-f5])
-(define-key xterm-function-map "\e[17;3~" [A-f6])
-(define-key xterm-function-map "\e[18;3~" [A-f7])
-(define-key xterm-function-map "\e[19;3~" [A-f8])
-(define-key xterm-function-map "\e[20;3~" [A-f9])
-(define-key xterm-function-map "\e[21;3~" [A-f10])
-(define-key xterm-function-map "\e[23;3~" [A-f11])
-(define-key xterm-function-map "\e[24;3~" [A-f12])
+    (define-key map "\eO3P" [A-f1])
+    (define-key map "\eO3Q" [A-f2])
+    (define-key map "\eO3R" [A-f3])
+    (define-key map "\eO3S" [A-f4])
+    (define-key map "\e[15;3~" [A-f5])
+    (define-key map "\e[17;3~" [A-f6])
+    (define-key map "\e[18;3~" [A-f7])
+    (define-key map "\e[19;3~" [A-f8])
+    (define-key map "\e[20;3~" [A-f9])
+    (define-key map "\e[21;3~" [A-f10])
+    (define-key map "\e[23;3~" [A-f11])
+    (define-key map "\e[24;3~" [A-f12])
 
-(define-key xterm-function-map "\eOA" [up])
-(define-key xterm-function-map "\eOB" [down])
-(define-key xterm-function-map "\eOC" [right])
-(define-key xterm-function-map "\eOD" [left])
-(define-key xterm-function-map "\eOF" [end])
-(define-key xterm-function-map "\eOH" [home])
+    (define-key map "\eOA" [up])
+    (define-key map "\eOB" [down])
+    (define-key map "\eOC" [right])
+    (define-key map "\eOD" [left])
+    (define-key map "\eOF" [end])
+    (define-key map "\eOH" [home])
 
-(define-key xterm-function-map "\e[1;2A" [S-up])
-(define-key xterm-function-map "\e[1;2B" [S-down])
-(define-key xterm-function-map "\e[1;2C" [S-right])
-(define-key xterm-function-map "\e[1;2D" [S-left])
-(define-key xterm-function-map "\e[1;2F" [S-end])
-(define-key xterm-function-map "\e[1;2H" [S-home])
+    (define-key map "\e[1;2A" [S-up])
+    (define-key map "\e[1;2B" [S-down])
+    (define-key map "\e[1;2C" [S-right])
+    (define-key map "\e[1;2D" [S-left])
+    (define-key map "\e[1;2F" [S-end])
+    (define-key map "\e[1;2H" [S-home])
 
-(define-key xterm-function-map "\e[1;5A" [C-up])
-(define-key xterm-function-map "\e[1;5B" [C-down])
-(define-key xterm-function-map "\e[1;5C" [C-right])
-(define-key xterm-function-map "\e[1;5D" [C-left])
-(define-key xterm-function-map "\e[1;5F" [C-end])
-(define-key xterm-function-map "\e[1;5H" [C-home])
+    (define-key map "\e[1;5A" [C-up])
+    (define-key map "\e[1;5B" [C-down])
+    (define-key map "\e[1;5C" [C-right])
+    (define-key map "\e[1;5D" [C-left])
+    (define-key map "\e[1;5F" [C-end])
+    (define-key map "\e[1;5H" [C-home])
 
-(define-key xterm-function-map "\e[1;6A" [C-S-up])
-(define-key xterm-function-map "\e[1;6B" [C-S-down])
-(define-key xterm-function-map "\e[1;6C" [C-S-right])
-(define-key xterm-function-map "\e[1;6D" [C-S-left])
-(define-key xterm-function-map "\e[1;6F" [C-S-end])
-(define-key xterm-function-map "\e[1;6H" [C-S-home])
+    (define-key map "\e[1;6A" [C-S-up])
+    (define-key map "\e[1;6B" [C-S-down])
+    (define-key map "\e[1;6C" [C-S-right])
+    (define-key map "\e[1;6D" [C-S-left])
+    (define-key map "\e[1;6F" [C-S-end])
+    (define-key map "\e[1;6H" [C-S-home])
 
-(define-key xterm-function-map "\e[1;3A" [A-up])
-(define-key xterm-function-map "\e[1;3B" [A-down])
-(define-key xterm-function-map "\e[1;3C" [A-right])
-(define-key xterm-function-map "\e[1;3D" [A-left])
-(define-key xterm-function-map "\e[1;3F" [A-end])
-(define-key xterm-function-map "\e[1;3H" [A-home])
+    (define-key map "\e[1;3A" [A-up])
+    (define-key map "\e[1;3B" [A-down])
+    (define-key map "\e[1;3C" [A-right])
+    (define-key map "\e[1;3D" [A-left])
+    (define-key map "\e[1;3F" [A-end])
+    (define-key map "\e[1;3H" [A-home])
 
-(define-key xterm-function-map "\e[2~" [insert])
-(define-key xterm-function-map "\e[3~" [delete])
-(define-key xterm-function-map "\e[5~" [prior])
-(define-key xterm-function-map "\e[6~" [next])
+    (define-key map "\e[2~" [insert])
+    (define-key map "\e[3~" [delete])
+    (define-key map "\e[5~" [prior])
+    (define-key map "\e[6~" [next])
 
-(define-key xterm-function-map "\e[2;2~" [S-insert])
-(define-key xterm-function-map "\e[3;2~" [S-delete])
-(define-key xterm-function-map "\e[5;2~" [S-prior])
-(define-key xterm-function-map "\e[6;2~" [S-next])
+    (define-key map "\e[2;2~" [S-insert])
+    (define-key map "\e[3;2~" [S-delete])
+    (define-key map "\e[5;2~" [S-prior])
+    (define-key map "\e[6;2~" [S-next])
 
-(define-key xterm-function-map "\e[2;5~" [C-insert])
-(define-key xterm-function-map "\e[3;5~" [C-delete])
-(define-key xterm-function-map "\e[5;5~" [C-prior])
-(define-key xterm-function-map "\e[6;5~" [C-next])
+    (define-key map "\e[2;5~" [C-insert])
+    (define-key map "\e[3;5~" [C-delete])
+    (define-key map "\e[5;5~" [C-prior])
+    (define-key map "\e[6;5~" [C-next])
 
-(define-key xterm-function-map "\e[2;6~" [C-S-insert])
-(define-key xterm-function-map "\e[3;6~" [C-S-delete])
-(define-key xterm-function-map "\e[5;6~" [C-S-prior])
-(define-key xterm-function-map "\e[6;6~" [C-S-next])
+    (define-key map "\e[2;6~" [C-S-insert])
+    (define-key map "\e[3;6~" [C-S-delete])
+    (define-key map "\e[5;6~" [C-S-prior])
+    (define-key map "\e[6;6~" [C-S-next])
 
-(define-key xterm-function-map "\e[2;3~" [A-insert])
-(define-key xterm-function-map "\e[3;3~" [A-delete])
-(define-key xterm-function-map "\e[5;3~" [A-prior])
-(define-key xterm-function-map "\e[6;3~" [A-next])
+    (define-key map "\e[2;3~" [A-insert])
+    (define-key map "\e[3;3~" [A-delete])
+    (define-key map "\e[5;3~" [A-prior])
+    (define-key map "\e[6;3~" [A-next])
 
-(define-key xterm-function-map "\e[4~" [select])
-(define-key xterm-function-map "\e[29~" [print])
+    (define-key map "\e[4~" [select])
+    (define-key map "\e[29~" [print])
 
-(define-key xterm-function-map "\eOj" [kp-multiply])
-(define-key xterm-function-map "\eOk" [kp-add])
-(define-key xterm-function-map "\eOl" [kp-separator])
-(define-key xterm-function-map "\eOm" [kp-subtract])
-(define-key xterm-function-map "\eOo" [kp-divide])
-(define-key xterm-function-map "\eOp" [kp-0])
-(define-key xterm-function-map "\eOq" [kp-1])
-(define-key xterm-function-map "\eOr" [kp-2])
-(define-key xterm-function-map "\eOs" [kp-3])
-(define-key xterm-function-map "\eOt" [kp-4])
-(define-key xterm-function-map "\eOu" [kp-5])
-(define-key xterm-function-map "\eOv" [kp-6])
-(define-key xterm-function-map "\eOw" [kp-7])
-(define-key xterm-function-map "\eOx" [kp-8])
-(define-key xterm-function-map "\eOy" [kp-9])
+    (define-key map "\eOj" [kp-multiply])
+    (define-key map "\eOk" [kp-add])
+    (define-key map "\eOl" [kp-separator])
+    (define-key map "\eOm" [kp-subtract])
+    (define-key map "\eOo" [kp-divide])
+    (define-key map "\eOp" [kp-0])
+    (define-key map "\eOq" [kp-1])
+    (define-key map "\eOr" [kp-2])
+    (define-key map "\eOs" [kp-3])
+    (define-key map "\eOt" [kp-4])
+    (define-key map "\eOu" [kp-5])
+    (define-key map "\eOv" [kp-6])
+    (define-key map "\eOw" [kp-7])
+    (define-key map "\eOx" [kp-8])
+    (define-key map "\eOy" [kp-9])
 
-;; These keys are available in xterm starting from version 216
-;; if the modifyOtherKeys resource is set to 1.
+    ;; These keys are available in xterm starting from version 216
+    ;; if the modifyOtherKeys resource is set to 1.
 
-(define-key xterm-function-map "\e[27;5;9~"   [C-tab])
-(define-key xterm-function-map "\e[27;5;13~"  [C-return])
-(define-key xterm-function-map "\e[27;5;39~"  [?\C-\'])
-(define-key xterm-function-map "\e[27;5;44~"  [?\C-,])
-(define-key xterm-function-map "\e[27;5;45~"  [?\C--])
-(define-key xterm-function-map "\e[27;5;46~"  [?\C-.])
-(define-key xterm-function-map "\e[27;5;47~"  [?\C-/])
-(define-key xterm-function-map "\e[27;5;48~"  [?\C-0])
-(define-key xterm-function-map "\e[27;5;49~"  [?\C-1])
-;; Not all C-DIGIT keys have a distinct binding.
-(define-key xterm-function-map "\e[27;5;57~"  [?\C-9])
-(define-key xterm-function-map "\e[27;5;59~"  [?\C-\;])
-(define-key xterm-function-map "\e[27;5;61~"  [?\C-=])
-(define-key xterm-function-map "\e[27;5;92~"  [?\C-\\])
+    (define-key map "\e[27;5;9~"   [C-tab])
+    (define-key map "\e[27;5;13~"  [C-return])
+    (define-key map "\e[27;5;39~"  [?\C-\'])
+    (define-key map "\e[27;5;44~"  [?\C-,])
+    (define-key map "\e[27;5;45~"  [?\C--])
+    (define-key map "\e[27;5;46~"  [?\C-.])
+    (define-key map "\e[27;5;47~"  [?\C-/])
+    (define-key map "\e[27;5;48~"  [?\C-0])
+    (define-key map "\e[27;5;49~"  [?\C-1])
+    ;; Not all C-DIGIT keys have a distinct binding.
+    (define-key map "\e[27;5;57~"  [?\C-9])
+    (define-key map "\e[27;5;59~"  [?\C-\;])
+    (define-key map "\e[27;5;61~"  [?\C-=])
+    (define-key map "\e[27;5;92~"  [?\C-\\])
 
-(define-key xterm-function-map "\e[27;6;33~"  [?\C-!])
-(define-key xterm-function-map "\e[27;6;34~"  [?\C-\"])
-(define-key xterm-function-map "\e[27;6;35~"  [?\C-#])
-(define-key xterm-function-map "\e[27;6;36~"  [?\C-$])
-(define-key xterm-function-map "\e[27;6;37~"  [?\C-%])
-(define-key xterm-function-map "\e[27;6;38~"  [?\C-&])
-(define-key xterm-function-map "\e[27;6;40~"  [?\C-(])
-(define-key xterm-function-map "\e[27;6;41~"  [?\C-)])
-(define-key xterm-function-map "\e[27;6;42~"  [?\C-*])
-(define-key xterm-function-map "\e[27;6;43~"  [?\C-+])
-(define-key xterm-function-map "\e[27;6;58~"  [?\C-:])
-(define-key xterm-function-map "\e[27;6;60~"  [?\C-<])
-(define-key xterm-function-map "\e[27;6;62~"  [?\C->])
-(define-key xterm-function-map "\e[27;6;63~"  [(control ??)])
+    (define-key map "\e[27;6;33~"  [?\C-!])
+    (define-key map "\e[27;6;34~"  [?\C-\"])
+    (define-key map "\e[27;6;35~"  [?\C-#])
+    (define-key map "\e[27;6;36~"  [?\C-$])
+    (define-key map "\e[27;6;37~"  [?\C-%])
+    (define-key map "\e[27;6;38~"  [?\C-&])
+    (define-key map "\e[27;6;40~"  [?\C-(])
+      (define-key map "\e[27;6;41~"  [?\C-)])
+    (define-key map "\e[27;6;42~"  [?\C-*])
+    (define-key map "\e[27;6;43~"  [?\C-+])
+    (define-key map "\e[27;6;58~"  [?\C-:])
+    (define-key map "\e[27;6;60~"  [?\C-<])
+    (define-key map "\e[27;6;62~"  [?\C->])
+    (define-key map "\e[27;6;63~"  [(control ??)])
 
-;; These are the strings emitted for various C-M- combinations
-;; for keyboards that the Meta and Alt modifiers are on the same
-;; key (usually labeled "Alt").
-(define-key xterm-function-map "\e[27;13;9~"  [C-M-tab])
-(define-key xterm-function-map "\e[27;13;13~" [C-M-return])
+    ;; These are the strings emitted for various C-M- combinations
+    ;; for keyboards that the Meta and Alt modifiers are on the same
+    ;; key (usually labeled "Alt").
+    (define-key map "\e[27;13;9~"  [C-M-tab])
+    (define-key map "\e[27;13;13~" [C-M-return])
 
-(define-key xterm-function-map "\e[27;13;39~" [?\C-\M-\'])
-(define-key xterm-function-map "\e[27;13;44~" [?\C-\M-,])
-(define-key xterm-function-map "\e[27;13;45~" [?\C-\M--])
-(define-key xterm-function-map "\e[27;13;46~" [?\C-\M-.])
-(define-key xterm-function-map "\e[27;13;47~" [?\C-\M-/])
-(define-key xterm-function-map "\e[27;13;48~" [?\C-\M-0])
-(define-key xterm-function-map "\e[27;13;49~" [?\C-\M-1])
-(define-key xterm-function-map "\e[27;13;50~" [?\C-\M-2])
-(define-key xterm-function-map "\e[27;13;51~" [?\C-\M-3])
-(define-key xterm-function-map "\e[27;13;52~" [?\C-\M-4])
-(define-key xterm-function-map "\e[27;13;53~" [?\C-\M-5])
-(define-key xterm-function-map "\e[27;13;54~" [?\C-\M-6])
-(define-key xterm-function-map "\e[27;13;55~" [?\C-\M-7])
-(define-key xterm-function-map "\e[27;13;56~" [?\C-\M-8])
-(define-key xterm-function-map "\e[27;13;57~" [?\C-\M-9])
-(define-key xterm-function-map "\e[27;13;59~" [?\C-\M-\;])
-(define-key xterm-function-map "\e[27;13;61~" [?\C-\M-=])
-(define-key xterm-function-map "\e[27;13;92~" [?\C-\M-\\])
+    (define-key map "\e[27;13;39~" [?\C-\M-\'])
+    (define-key map "\e[27;13;44~" [?\C-\M-,])
+    (define-key map "\e[27;13;45~" [?\C-\M--])
+    (define-key map "\e[27;13;46~" [?\C-\M-.])
+    (define-key map "\e[27;13;47~" [?\C-\M-/])
+    (define-key map "\e[27;13;48~" [?\C-\M-0])
+    (define-key map "\e[27;13;49~" [?\C-\M-1])
+    (define-key map "\e[27;13;50~" [?\C-\M-2])
+    (define-key map "\e[27;13;51~" [?\C-\M-3])
+    (define-key map "\e[27;13;52~" [?\C-\M-4])
+    (define-key map "\e[27;13;53~" [?\C-\M-5])
+    (define-key map "\e[27;13;54~" [?\C-\M-6])
+    (define-key map "\e[27;13;55~" [?\C-\M-7])
+    (define-key map "\e[27;13;56~" [?\C-\M-8])
+    (define-key map "\e[27;13;57~" [?\C-\M-9])
+    (define-key map "\e[27;13;59~" [?\C-\M-\;])
+    (define-key map "\e[27;13;61~" [?\C-\M-=])
+    (define-key map "\e[27;13;92~" [?\C-\M-\\])
 
-(define-key xterm-function-map "\e[27;14;33~"  [?\C-\M-!])
-(define-key xterm-function-map "\e[27;14;34~"  [?\C-\M-\"])
-(define-key xterm-function-map "\e[27;14;35~"  [?\C-\M-#])
-(define-key xterm-function-map "\e[27;14;36~"  [?\C-\M-$])
-(define-key xterm-function-map "\e[27;14;37~"  [?\C-\M-%])
-(define-key xterm-function-map "\e[27;14;38~"  [?\C-\M-&])
-(define-key xterm-function-map "\e[27;14;40~"  [?\C-\M-\(])
-(define-key xterm-function-map "\e[27;14;41~"  [?\C-\M-\)])
-(define-key xterm-function-map "\e[27;14;42~"  [?\C-\M-*])
-(define-key xterm-function-map "\e[27;14;43~"  [?\C-\M-+])
-(define-key xterm-function-map "\e[27;14;58~"  [?\C-\M-:])
-(define-key xterm-function-map "\e[27;14;60~"  [?\C-\M-<])
-(define-key xterm-function-map "\e[27;14;62~"  [?\C-\M->])
-(define-key xterm-function-map "\e[27;14;63~"  [(control meta ??)])
+    (define-key map "\e[27;14;33~"  [?\C-\M-!])
+    (define-key map "\e[27;14;34~"  [?\C-\M-\"])
+    (define-key map "\e[27;14;35~"  [?\C-\M-#])
+    (define-key map "\e[27;14;36~"  [?\C-\M-$])
+    (define-key map "\e[27;14;37~"  [?\C-\M-%])
+    (define-key map "\e[27;14;38~"  [?\C-\M-&])
+    (define-key map "\e[27;14;40~"  [?\C-\M-\(])
+    (define-key map "\e[27;14;41~"  [?\C-\M-\)])
+    (define-key map "\e[27;14;42~"  [?\C-\M-*])
+    (define-key map "\e[27;14;43~"  [?\C-\M-+])
+    (define-key map "\e[27;14;58~"  [?\C-\M-:])
+    (define-key map "\e[27;14;60~"  [?\C-\M-<])
+    (define-key map "\e[27;14;62~"  [?\C-\M->])
+    (define-key map "\e[27;14;63~"  [(control meta ??)])
 
-(define-key xterm-function-map "\e[27;7;9~"  [C-M-tab])
-(define-key xterm-function-map "\e[27;7;13~" [C-M-return])
+    (define-key map "\e[27;7;9~"  [C-M-tab])
+    (define-key map "\e[27;7;13~" [C-M-return])
 
-(define-key xterm-function-map "\e[27;7;32~" [?\C-\M-\s])
-(define-key xterm-function-map "\e[27;7;39~" [?\C-\M-\'])
-(define-key xterm-function-map "\e[27;7;44~" [?\C-\M-,])
-(define-key xterm-function-map "\e[27;7;45~" [?\C-\M--])
-(define-key xterm-function-map "\e[27;7;46~" [?\C-\M-.])
-(define-key xterm-function-map "\e[27;7;47~" [?\C-\M-/])
-(define-key xterm-function-map "\e[27;7;48~" [?\C-\M-0])
-(define-key xterm-function-map "\e[27;7;49~" [?\C-\M-1])
-(define-key xterm-function-map "\e[27;7;50~" [?\C-\M-2])
-(define-key xterm-function-map "\e[27;7;51~" [?\C-\M-3])
-(define-key xterm-function-map "\e[27;7;52~" [?\C-\M-4])
-(define-key xterm-function-map "\e[27;7;53~" [?\C-\M-5])
-(define-key xterm-function-map "\e[27;7;54~" [?\C-\M-6])
-(define-key xterm-function-map "\e[27;7;55~" [?\C-\M-7])
-(define-key xterm-function-map "\e[27;7;56~" [?\C-\M-8])
-(define-key xterm-function-map "\e[27;7;57~" [?\C-\M-9])
-(define-key xterm-function-map "\e[27;7;59~" [?\C-\M-\;])
-(define-key xterm-function-map "\e[27;7;61~" [?\C-\M-=])
-(define-key xterm-function-map "\e[27;7;92~" [?\C-\M-\\])
+    (define-key map "\e[27;7;32~" [?\C-\M-\s])
+    (define-key map "\e[27;7;39~" [?\C-\M-\'])
+    (define-key map "\e[27;7;44~" [?\C-\M-,])
+    (define-key map "\e[27;7;45~" [?\C-\M--])
+    (define-key map "\e[27;7;46~" [?\C-\M-.])
+    (define-key map "\e[27;7;47~" [?\C-\M-/])
+    (define-key map "\e[27;7;48~" [?\C-\M-0])
+    (define-key map "\e[27;7;49~" [?\C-\M-1])
+    (define-key map "\e[27;7;50~" [?\C-\M-2])
+    (define-key map "\e[27;7;51~" [?\C-\M-3])
+    (define-key map "\e[27;7;52~" [?\C-\M-4])
+    (define-key map "\e[27;7;53~" [?\C-\M-5])
+    (define-key map "\e[27;7;54~" [?\C-\M-6])
+    (define-key map "\e[27;7;55~" [?\C-\M-7])
+    (define-key map "\e[27;7;56~" [?\C-\M-8])
+    (define-key map "\e[27;7;57~" [?\C-\M-9])
+    (define-key map "\e[27;7;59~" [?\C-\M-\;])
+    (define-key map "\e[27;7;61~" [?\C-\M-=])
+    (define-key map "\e[27;7;92~" [?\C-\M-\\])
 
-(define-key xterm-function-map "\e[27;8;33~"  [?\C-\M-!])
-(define-key xterm-function-map "\e[27;8;34~"  [?\C-\M-\"])
-(define-key xterm-function-map "\e[27;8;35~"  [?\C-\M-#])
-(define-key xterm-function-map "\e[27;8;36~"  [?\C-\M-$])
-(define-key xterm-function-map "\e[27;8;37~"  [?\C-\M-%])
-(define-key xterm-function-map "\e[27;8;38~"  [?\C-\M-&])
-(define-key xterm-function-map "\e[27;8;40~"  [?\C-\M-\(])
-(define-key xterm-function-map "\e[27;8;41~"  [?\C-\M-\)])
-(define-key xterm-function-map "\e[27;8;42~"  [?\C-\M-*])
-(define-key xterm-function-map "\e[27;8;43~"  [?\C-\M-+])
-(define-key xterm-function-map "\e[27;8;58~"  [?\C-\M-:])
-(define-key xterm-function-map "\e[27;8;60~"  [?\C-\M-<])
-(define-key xterm-function-map "\e[27;8;62~"  [?\C-\M->])
-(define-key xterm-function-map "\e[27;8;63~"  [(control meta ??)])
+    (define-key map "\e[27;8;33~"  [?\C-\M-!])
+    (define-key map "\e[27;8;34~"  [?\C-\M-\"])
+    (define-key map "\e[27;8;35~"  [?\C-\M-#])
+    (define-key map "\e[27;8;36~"  [?\C-\M-$])
+    (define-key map "\e[27;8;37~"  [?\C-\M-%])
+    (define-key map "\e[27;8;38~"  [?\C-\M-&])
+    (define-key map "\e[27;8;40~"  [?\C-\M-\(])
+    (define-key map "\e[27;8;41~"  [?\C-\M-\)])
+    (define-key map "\e[27;8;42~"  [?\C-\M-*])
+    (define-key map "\e[27;8;43~"  [?\C-\M-+])
+    (define-key map "\e[27;8;58~"  [?\C-\M-:])
+    (define-key map "\e[27;8;60~"  [?\C-\M-<])
+    (define-key map "\e[27;8;62~"  [?\C-\M->])
+    (define-key map "\e[27;8;63~"  [(control meta ??)])
 
-(define-key xterm-function-map "\e[27;2;9~"   [S-tab])
-(define-key xterm-function-map "\e[27;2;13~"  [S-return])
+    (define-key map "\e[27;2;9~"   [S-tab])
+    (define-key map "\e[27;2;13~"  [S-return])
 
-(define-key xterm-function-map "\e[27;6;9~"   [C-S-tab])
-(define-key xterm-function-map "\e[27;6;13~"  [C-S-return])
+    (define-key map "\e[27;6;9~"   [C-S-tab])
+    (define-key map "\e[27;6;13~"  [C-S-return])
 
-;; Other versions of xterm might emit these.
-(define-key xterm-function-map "\e[A" [up])
-(define-key xterm-function-map "\e[B" [down])
-(define-key xterm-function-map "\e[C" [right])
-(define-key xterm-function-map "\e[D" [left])
-(define-key xterm-function-map "\e[1~" [home])
+    ;; Other versions of xterm might emit these.
+    (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[1;2A" [S-up])
+    (define-key map "\e[1;2B" [S-down])
+    (define-key map "\e[1;2C" [S-right])
+    (define-key map "\e[1;2D" [S-left])
+    (define-key map "\e[1;2F" [S-end])
+    (define-key map "\e[1;2H" [S-home])
 
-(define-key xterm-function-map "\e[1;2A" [S-up])
-(define-key xterm-function-map "\e[1;2B" [S-down])
-(define-key xterm-function-map "\e[1;2C" [S-right])
-(define-key xterm-function-map "\e[1;2D" [S-left])
-(define-key xterm-function-map "\e[1;2F" [S-end])
-(define-key xterm-function-map "\e[1;2H" [S-home])
+    (define-key map "\e[1;5A" [C-up])
+    (define-key map "\e[1;5B" [C-down])
+    (define-key map "\e[1;5C" [C-right])
+    (define-key map "\e[1;5D" [C-left])
+    (define-key map "\e[1;5F" [C-end])
+    (define-key map "\e[1;5H" [C-home])
 
-(define-key xterm-function-map "\e[1;5A" [C-up])
-(define-key xterm-function-map "\e[1;5B" [C-down])
-(define-key xterm-function-map "\e[1;5C" [C-right])
-(define-key xterm-function-map "\e[1;5D" [C-left])
-(define-key xterm-function-map "\e[1;5F" [C-end])
-(define-key xterm-function-map "\e[1;5H" [C-home])
-
-(define-key xterm-function-map "\e[11~" [f1])
-(define-key xterm-function-map "\e[12~" [f2])
-(define-key xterm-function-map "\e[13~" [f3])
-(define-key xterm-function-map "\e[14~" [f4])
+    (define-key map "\e[11~" [f1])
+    (define-key map "\e[12~" [f2])
+    (define-key map "\e[13~" [f3])
+    (define-key map "\e[14~" [f4])
+    map)
+  "Function key map overrides for xterm.")
 
 ;; List of terminals for which modify-other-keys has been turned on.
 (defvar xterm-modify-other-keys-terminal-list nil)
@@ -334,14 +336,13 @@
 	   (string-match "\\`rxvt" (getenv "COLORTERM" (selected-frame))))
       (tty-run-terminal-initialization (selected-frame) "rxvt")
 
-    ;; The terminal intialization C code file might have initialized
-    ;; function keys F13->F60 from the termcap/terminfo information.  On
-    ;; a PC-style keyboard these keys correspond to
-    ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-.  The
-    ;; code here subsitutes the corresponding defintions in
-    ;; function-key-map. This substitution is needed because if a key
-    ;; definition is found in function-key-map, there are no further
-    ;; lookups in other keymaps.
+    ;; The terminal initialization C code file might have initialized
+    ;; function keys F13->F60 from the termcap/terminfo information.
+    ;; On a PC-style keyboard these keys correspond to
+    ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-.  The code
+    ;; here substitutes the corresponding definitions in function-key-map.
+    ;; This substitution is needed because if a key definition is found in
+    ;; function-key-map, there are no further lookups in other keymaps.
     (substitute-key-definition [f13] [S-f1] local-function-key-map)
     (substitute-key-definition [f14] [S-f2] local-function-key-map)
     (substitute-key-definition [f15] [S-f3] local-function-key-map)
@@ -427,7 +428,7 @@
 	    ;; NUMBER2 is the xterm version number, look for something
 	    ;; greater than 216, the version when modifyOtherKeys was
 	    ;; introduced.
-	    (when (>= (string-to-number 
+	    (when (>= (string-to-number
 		       (substring str (match-beginning 1) (match-end 1))) 216)
 	      ;; Make sure that the modifyOtherKeys state is restored when
 	      ;; suspending, resuming and exiting.
@@ -437,7 +438,7 @@
 	      (add-hook 'delete-frame-hook 'xterm-remove-modify-other-keys)
 	      ;; Add the selected frame to the list of frames that
 	      ;; need to deal with modify-other-keys.
-	      (push (frame-terminal (selected-frame)) 
+	      (push (frame-terminal (selected-frame))
 		    xterm-modify-other-keys-terminal-list)
 	      (xterm-turn-on-modify-other-keys)))))))
 
@@ -576,8 +577,8 @@
   (setq frame (and frame (selected-frame)))
   (when (and (frame-live-p frame)
 	     (memq frame xterm-modify-other-keys-terminal-list))
-    (setq xterm-modify-other-keys-terminal-list 
-	  (delq (frame-terminal frame) 
+    (setq xterm-modify-other-keys-terminal-list
+	  (delq (frame-terminal frame)
 		xterm-modify-other-keys-terminal-list))
     (send-string-to-terminal "\e[>4m")))