annotate lisp/term/xterm.el @ 108932:21c602686f38

Close bug#6336. * lisp/desktop.el (desktop-clear-preserve-buffers): Add "*Warnings*" buffer.
author Glenn Morris <rgm@gnu.org>
date Wed, 02 Jun 2010 23:07:39 -0700
parents 8839cd62c3d2
children 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
1 ;;; xterm.el --- define function key sequences and standard colors for xterm
12159
e83a888f32d9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
74509
f7702c5f335d Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 73997
diff changeset
3 ;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106469
diff changeset
4 ;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
5
12159
e83a888f32d9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6 ;; Author: FSF
e83a888f32d9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7 ;; Keywords: terminals
e83a888f32d9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
9 ;; This file is part of GNU Emacs.
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
10
94671
f3ab0c2464f5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93370
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
94671
f3ab0c2464f5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93370
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
f3ab0c2464f5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93370
diff changeset
14 ;; (at your option) any later version.
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
15
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
19 ;; GNU General Public License for more details.
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
20
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 12159
diff changeset
21 ;; You should have received a copy of the GNU General Public License
94671
f3ab0c2464f5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93370
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
12159
e83a888f32d9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
23
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 14170
diff changeset
24 ;;; Commentary:
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 14170
diff changeset
25
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 14170
diff changeset
26 ;;; Code:
12159
e83a888f32d9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
28 (defvar xterm-function-map
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
29 (let ((map (make-sparse-keymap)))
61977
4039ddc27a88 (function-key-map): Call substitute-key-definition
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61842
diff changeset
30
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
31 ;; xterm from X.org 6.8.2 uses these key definitions.
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
32 (define-key map "\eOP" [f1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
33 (define-key map "\eOQ" [f2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
34 (define-key map "\eOR" [f3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
35 (define-key map "\eOS" [f4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
36 (define-key map "\e[15~" [f5])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
37 (define-key map "\e[17~" [f6])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
38 (define-key map "\e[18~" [f7])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
39 (define-key map "\e[19~" [f8])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
40 (define-key map "\e[20~" [f9])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
41 (define-key map "\e[21~" [f10])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
42 (define-key map "\e[23~" [f11])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
43 (define-key map "\e[24~" [f12])
61977
4039ddc27a88 (function-key-map): Call substitute-key-definition
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61842
diff changeset
44
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
45 (define-key map "\eO2P" [S-f1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
46 (define-key map "\eO2Q" [S-f2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
47 (define-key map "\eO2R" [S-f3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
48 (define-key map "\eO2S" [S-f4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
49 (define-key map "\e[1;2P" [S-f1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
50 (define-key map "\e[1;2Q" [S-f2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
51 (define-key map "\e[1;2R" [S-f3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
52 (define-key map "\e[1;2S" [S-f4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
53 (define-key map "\e[15;2~" [S-f5])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
54 (define-key map "\e[17;2~" [S-f6])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
55 (define-key map "\e[18;2~" [S-f7])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
56 (define-key map "\e[19;2~" [S-f8])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
57 (define-key map "\e[20;2~" [S-f9])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
58 (define-key map "\e[21;2~" [S-f10])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
59 (define-key map "\e[23;2~" [S-f11])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
60 (define-key map "\e[24;2~" [S-f12])
83524
673d62ad74b5 Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents: 83517
diff changeset
61
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
62 (define-key map "\eO5P" [C-f1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
63 (define-key map "\eO5Q" [C-f2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
64 (define-key map "\eO5R" [C-f3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
65 (define-key map "\eO5S" [C-f4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
66 (define-key map "\e[15;5~" [C-f5])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
67 (define-key map "\e[17;5~" [C-f6])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
68 (define-key map "\e[18;5~" [C-f7])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
69 (define-key map "\e[19;5~" [C-f8])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
70 (define-key map "\e[20;5~" [C-f9])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
71 (define-key map "\e[21;5~" [C-f10])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
72 (define-key map "\e[23;5~" [C-f11])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
73 (define-key map "\e[24;5~" [C-f12])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
74
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
75 (define-key map "\eO6P" [C-S-f1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
76 (define-key map "\eO6Q" [C-S-f2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
77 (define-key map "\eO6R" [C-S-f3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
78 (define-key map "\eO6S" [C-S-f4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
79 (define-key map "\e[15;6~" [C-S-f5])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
80 (define-key map "\e[17;6~" [C-S-f6])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
81 (define-key map "\e[18;6~" [C-S-f7])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
82 (define-key map "\e[19;6~" [C-S-f8])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
83 (define-key map "\e[20;6~" [C-S-f9])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
84 (define-key map "\e[21;6~" [C-S-f10])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
85 (define-key map "\e[23;6~" [C-S-f11])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
86 (define-key map "\e[24;6~" [C-S-f12])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
87
85203
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
88 (define-key map "\eO3P" [M-f1])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
89 (define-key map "\eO3Q" [M-f2])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
90 (define-key map "\eO3R" [M-f3])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
91 (define-key map "\eO3S" [M-f4])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
92 (define-key map "\e[15;3~" [M-f5])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
93 (define-key map "\e[17;3~" [M-f6])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
94 (define-key map "\e[18;3~" [M-f7])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
95 (define-key map "\e[19;3~" [M-f8])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
96 (define-key map "\e[20;3~" [M-f9])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
97 (define-key map "\e[21;3~" [M-f10])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
98 (define-key map "\e[23;3~" [M-f11])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
99 (define-key map "\e[24;3~" [M-f12])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
100
84510
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
101 (define-key map "\eO4P" [M-S-f1])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
102 (define-key map "\eO4Q" [M-S-f2])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
103 (define-key map "\eO4R" [M-S-f3])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
104 (define-key map "\eO4S" [M-S-f4])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
105 (define-key map "\e[15;4~" [M-S-f5])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
106 (define-key map "\e[17;4~" [M-S-f6])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
107 (define-key map "\e[18;4~" [M-S-f7])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
108 (define-key map "\e[19;4~" [M-S-f8])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
109 (define-key map "\e[20;4~" [M-S-f9])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
110 (define-key map "\e[21;4~" [M-S-f10])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
111 (define-key map "\e[23;4~" [M-S-f11])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
112 (define-key map "\e[24;4~" [M-S-f12])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
113
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
114 (define-key map "\eOA" [up])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
115 (define-key map "\eOB" [down])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
116 (define-key map "\eOC" [right])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
117 (define-key map "\eOD" [left])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
118 (define-key map "\eOF" [end])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
119 (define-key map "\eOH" [home])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
120
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
121 (define-key map "\e[1;2A" [S-up])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
122 (define-key map "\e[1;2B" [S-down])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
123 (define-key map "\e[1;2C" [S-right])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
124 (define-key map "\e[1;2D" [S-left])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
125 (define-key map "\e[1;2F" [S-end])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
126 (define-key map "\e[1;2H" [S-home])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
127
84510
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
128 (define-key map "\e[1;4A" [M-S-up])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
129 (define-key map "\e[1;4B" [M-S-down])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
130 (define-key map "\e[1;4C" [M-S-right])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
131 (define-key map "\e[1;4D" [M-S-left])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
132 (define-key map "\e[1;4F" [M-S-end])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
133 (define-key map "\e[1;4H" [M-S-home])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
134
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
135 (define-key map "\e[1;5A" [C-up])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
136 (define-key map "\e[1;5B" [C-down])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
137 (define-key map "\e[1;5C" [C-right])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
138 (define-key map "\e[1;5D" [C-left])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
139 (define-key map "\e[1;5F" [C-end])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
140 (define-key map "\e[1;5H" [C-home])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
141
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
142 (define-key map "\e[1;6A" [C-S-up])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
143 (define-key map "\e[1;6B" [C-S-down])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
144 (define-key map "\e[1;6C" [C-S-right])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
145 (define-key map "\e[1;6D" [C-S-left])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
146 (define-key map "\e[1;6F" [C-S-end])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
147 (define-key map "\e[1;6H" [C-S-home])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
148
84545
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
149 (define-key map "\e[1;7A" [C-M-up])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
150 (define-key map "\e[1;7B" [C-M-down])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
151 (define-key map "\e[1;7C" [C-M-right])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
152 (define-key map "\e[1;7D" [C-M-left])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
153 (define-key map "\e[1;7F" [C-M-end])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
154 (define-key map "\e[1;7H" [C-M-home])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
155
84510
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
156 (define-key map "\e[1;8A" [C-M-S-up])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
157 (define-key map "\e[1;8B" [C-M-S-down])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
158 (define-key map "\e[1;8C" [C-M-S-right])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
159 (define-key map "\e[1;8D" [C-M-S-left])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
160 (define-key map "\e[1;8F" [C-M-S-end])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
161 (define-key map "\e[1;8H" [C-M-S-home])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
162
85203
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
163 (define-key map "\e[1;3A" [M-up])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
164 (define-key map "\e[1;3B" [M-down])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
165 (define-key map "\e[1;3C" [M-right])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
166 (define-key map "\e[1;3D" [M-left])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
167 (define-key map "\e[1;3F" [M-end])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
168 (define-key map "\e[1;3H" [M-home])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
169
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
170 (define-key map "\e[2~" [insert])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
171 (define-key map "\e[3~" [delete])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
172 (define-key map "\e[5~" [prior])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
173 (define-key map "\e[6~" [next])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
174
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
175 (define-key map "\e[2;2~" [S-insert])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
176 (define-key map "\e[3;2~" [S-delete])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
177 (define-key map "\e[5;2~" [S-prior])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
178 (define-key map "\e[6;2~" [S-next])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
179
84510
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
180 (define-key map "\e[2;4~" [M-S-insert])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
181 (define-key map "\e[3;4~" [M-S-delete])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
182 (define-key map "\e[5;4~" [M-S-prior])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
183 (define-key map "\e[6;4~" [M-S-next])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
184
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
185 (define-key map "\e[2;5~" [C-insert])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
186 (define-key map "\e[3;5~" [C-delete])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
187 (define-key map "\e[5;5~" [C-prior])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
188 (define-key map "\e[6;5~" [C-next])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
189
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
190 (define-key map "\e[2;6~" [C-S-insert])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
191 (define-key map "\e[3;6~" [C-S-delete])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
192 (define-key map "\e[5;6~" [C-S-prior])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
193 (define-key map "\e[6;6~" [C-S-next])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
194
84545
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
195 (define-key map "\e[2;7~" [C-M-insert])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
196 (define-key map "\e[3;7~" [C-M-delete])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
197 (define-key map "\e[5;7~" [C-M-prior])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
198 (define-key map "\e[6;7~" [C-M-next])
4abcc15327e8 (xterm-function-map): Add C-M- bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84510
diff changeset
199
84510
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
200 (define-key map "\e[2;8~" [C-M-S-insert])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
201 (define-key map "\e[3;8~" [C-M-S-delete])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
202 (define-key map "\e[5;8~" [C-M-S-prior])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
203 (define-key map "\e[6;8~" [C-M-S-next])
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
204
85203
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
205 (define-key map "\e[2;3~" [M-insert])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
206 (define-key map "\e[3;3~" [M-delete])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
207 (define-key map "\e[5;3~" [M-prior])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
208 (define-key map "\e[6;3~" [M-next])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
209
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
210 (define-key map "\e[4~" [select])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
211 (define-key map "\e[29~" [print])
83353
532e0a9335a9 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
parents: 83346 65314
diff changeset
212
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
213 (define-key map "\eOj" [kp-multiply])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
214 (define-key map "\eOk" [kp-add])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
215 (define-key map "\eOl" [kp-separator])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
216 (define-key map "\eOm" [kp-subtract])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
217 (define-key map "\eOo" [kp-divide])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
218 (define-key map "\eOp" [kp-0])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
219 (define-key map "\eOq" [kp-1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
220 (define-key map "\eOr" [kp-2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
221 (define-key map "\eOs" [kp-3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
222 (define-key map "\eOt" [kp-4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
223 (define-key map "\eOu" [kp-5])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
224 (define-key map "\eOv" [kp-6])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
225 (define-key map "\eOw" [kp-7])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
226 (define-key map "\eOx" [kp-8])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
227 (define-key map "\eOy" [kp-9])
83561
dc002877ce12 Merged from emacs@sv.gnu.org
Karoly Lorentey <karoly@lorentey.hu>
parents: 83554 77065
diff changeset
228
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
229 ;; These keys are available in xterm starting from version 216
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
230 ;; if the modifyOtherKeys resource is set to 1.
83541
694bbb62a75d Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83534 72312
diff changeset
231
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
232 (define-key map "\e[27;5;9~" [C-tab])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
233 (define-key map "\e[27;5;13~" [C-return])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
234 (define-key map "\e[27;5;39~" [?\C-\'])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
235 (define-key map "\e[27;5;44~" [?\C-,])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
236 (define-key map "\e[27;5;45~" [?\C--])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
237 (define-key map "\e[27;5;46~" [?\C-.])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
238 (define-key map "\e[27;5;47~" [?\C-/])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
239 (define-key map "\e[27;5;48~" [?\C-0])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
240 (define-key map "\e[27;5;49~" [?\C-1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
241 ;; Not all C-DIGIT keys have a distinct binding.
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
242 (define-key map "\e[27;5;57~" [?\C-9])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
243 (define-key map "\e[27;5;59~" [?\C-\;])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
244 (define-key map "\e[27;5;61~" [?\C-=])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
245 (define-key map "\e[27;5;92~" [?\C-\\])
83541
694bbb62a75d Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83534 72312
diff changeset
246
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
247 (define-key map "\e[27;6;33~" [?\C-!])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
248 (define-key map "\e[27;6;34~" [?\C-\"])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
249 (define-key map "\e[27;6;35~" [?\C-#])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
250 (define-key map "\e[27;6;36~" [?\C-$])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
251 (define-key map "\e[27;6;37~" [?\C-%])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
252 (define-key map "\e[27;6;38~" [?\C-&])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
253 (define-key map "\e[27;6;40~" [?\C-(])
84510
83341575ba12 * term/xterm.el (xterm-function-map): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84379
diff changeset
254 (define-key map "\e[27;6;41~" [?\C-)])
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
255 (define-key map "\e[27;6;42~" [?\C-*])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
256 (define-key map "\e[27;6;43~" [?\C-+])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
257 (define-key map "\e[27;6;58~" [?\C-:])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
258 (define-key map "\e[27;6;60~" [?\C-<])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
259 (define-key map "\e[27;6;62~" [?\C->])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
260 (define-key map "\e[27;6;63~" [(control ??)])
83541
694bbb62a75d Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83534 72312
diff changeset
261
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
262 ;; These are the strings emitted for various C-M- combinations
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
263 ;; for keyboards that the Meta and Alt modifiers are on the same
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
264 ;; key (usually labeled "Alt").
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
265 (define-key map "\e[27;13;9~" [C-M-tab])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
266 (define-key map "\e[27;13;13~" [C-M-return])
83542
2d56e13fd23d Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83541 72652
diff changeset
267
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
268 (define-key map "\e[27;13;39~" [?\C-\M-\'])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
269 (define-key map "\e[27;13;44~" [?\C-\M-,])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
270 (define-key map "\e[27;13;45~" [?\C-\M--])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
271 (define-key map "\e[27;13;46~" [?\C-\M-.])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
272 (define-key map "\e[27;13;47~" [?\C-\M-/])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
273 (define-key map "\e[27;13;48~" [?\C-\M-0])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
274 (define-key map "\e[27;13;49~" [?\C-\M-1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
275 (define-key map "\e[27;13;50~" [?\C-\M-2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
276 (define-key map "\e[27;13;51~" [?\C-\M-3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
277 (define-key map "\e[27;13;52~" [?\C-\M-4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
278 (define-key map "\e[27;13;53~" [?\C-\M-5])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
279 (define-key map "\e[27;13;54~" [?\C-\M-6])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
280 (define-key map "\e[27;13;55~" [?\C-\M-7])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
281 (define-key map "\e[27;13;56~" [?\C-\M-8])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
282 (define-key map "\e[27;13;57~" [?\C-\M-9])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
283 (define-key map "\e[27;13;59~" [?\C-\M-\;])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
284 (define-key map "\e[27;13;61~" [?\C-\M-=])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
285 (define-key map "\e[27;13;92~" [?\C-\M-\\])
83542
2d56e13fd23d Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83541 72652
diff changeset
286
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
287 (define-key map "\e[27;14;33~" [?\C-\M-!])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
288 (define-key map "\e[27;14;34~" [?\C-\M-\"])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
289 (define-key map "\e[27;14;35~" [?\C-\M-#])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
290 (define-key map "\e[27;14;36~" [?\C-\M-$])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
291 (define-key map "\e[27;14;37~" [?\C-\M-%])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
292 (define-key map "\e[27;14;38~" [?\C-\M-&])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
293 (define-key map "\e[27;14;40~" [?\C-\M-\(])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
294 (define-key map "\e[27;14;41~" [?\C-\M-\)])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
295 (define-key map "\e[27;14;42~" [?\C-\M-*])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
296 (define-key map "\e[27;14;43~" [?\C-\M-+])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
297 (define-key map "\e[27;14;58~" [?\C-\M-:])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
298 (define-key map "\e[27;14;60~" [?\C-\M-<])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
299 (define-key map "\e[27;14;62~" [?\C-\M->])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
300 (define-key map "\e[27;14;63~" [(control meta ??)])
83533
02e39decdc84 Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83531 72145
diff changeset
301
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
302 (define-key map "\e[27;7;9~" [C-M-tab])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
303 (define-key map "\e[27;7;13~" [C-M-return])
83533
02e39decdc84 Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83531 72145
diff changeset
304
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
305 (define-key map "\e[27;7;32~" [?\C-\M-\s])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
306 (define-key map "\e[27;7;39~" [?\C-\M-\'])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
307 (define-key map "\e[27;7;44~" [?\C-\M-,])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
308 (define-key map "\e[27;7;45~" [?\C-\M--])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
309 (define-key map "\e[27;7;46~" [?\C-\M-.])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
310 (define-key map "\e[27;7;47~" [?\C-\M-/])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
311 (define-key map "\e[27;7;48~" [?\C-\M-0])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
312 (define-key map "\e[27;7;49~" [?\C-\M-1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
313 (define-key map "\e[27;7;50~" [?\C-\M-2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
314 (define-key map "\e[27;7;51~" [?\C-\M-3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
315 (define-key map "\e[27;7;52~" [?\C-\M-4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
316 (define-key map "\e[27;7;53~" [?\C-\M-5])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
317 (define-key map "\e[27;7;54~" [?\C-\M-6])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
318 (define-key map "\e[27;7;55~" [?\C-\M-7])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
319 (define-key map "\e[27;7;56~" [?\C-\M-8])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
320 (define-key map "\e[27;7;57~" [?\C-\M-9])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
321 (define-key map "\e[27;7;59~" [?\C-\M-\;])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
322 (define-key map "\e[27;7;61~" [?\C-\M-=])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
323 (define-key map "\e[27;7;92~" [?\C-\M-\\])
83533
02e39decdc84 Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83531 72145
diff changeset
324
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
325 (define-key map "\e[27;8;33~" [?\C-\M-!])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
326 (define-key map "\e[27;8;34~" [?\C-\M-\"])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
327 (define-key map "\e[27;8;35~" [?\C-\M-#])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
328 (define-key map "\e[27;8;36~" [?\C-\M-$])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
329 (define-key map "\e[27;8;37~" [?\C-\M-%])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
330 (define-key map "\e[27;8;38~" [?\C-\M-&])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
331 (define-key map "\e[27;8;40~" [?\C-\M-\(])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
332 (define-key map "\e[27;8;41~" [?\C-\M-\)])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
333 (define-key map "\e[27;8;42~" [?\C-\M-*])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
334 (define-key map "\e[27;8;43~" [?\C-\M-+])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
335 (define-key map "\e[27;8;58~" [?\C-\M-:])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
336 (define-key map "\e[27;8;60~" [?\C-\M-<])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
337 (define-key map "\e[27;8;62~" [?\C-\M->])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
338 (define-key map "\e[27;8;63~" [(control meta ??)])
83533
02e39decdc84 Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83531 72145
diff changeset
339
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
340 (define-key map "\e[27;2;9~" [S-tab])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
341 (define-key map "\e[27;2;13~" [S-return])
83542
2d56e13fd23d Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83541 72652
diff changeset
342
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
343 (define-key map "\e[27;6;9~" [C-S-tab])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
344 (define-key map "\e[27;6;13~" [C-S-return])
83516
1321f6cfb389 Merged from emacs@sv.gnu.org
Karoly Lorentey <lorentey@elte.hu>
parents: 83468 70529
diff changeset
345
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
346 ;; Other versions of xterm might emit these.
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
347 (define-key map "\e[A" [up])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
348 (define-key map "\e[B" [down])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
349 (define-key map "\e[C" [right])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
350 (define-key map "\e[D" [left])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
351 (define-key map "\e[1~" [home])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
352
84569
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
353 (define-key map "\eO2A" [S-up])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
354 (define-key map "\eO2B" [S-down])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
355 (define-key map "\eO2C" [S-right])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
356 (define-key map "\eO2D" [S-left])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
357 (define-key map "\eO2F" [S-end])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
358 (define-key map "\eO2H" [S-home])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
359
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
360 (define-key map "\eO5A" [C-up])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
361 (define-key map "\eO5B" [C-down])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
362 (define-key map "\eO5C" [C-right])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
363 (define-key map "\eO5D" [C-left])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
364 (define-key map "\eO5F" [C-end])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
365 (define-key map "\eO5H" [C-home])
cad259e522a5 (xterm-function-map): Replace bindings that were
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84568
diff changeset
366
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
367 (define-key map "\e[11~" [f1])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
368 (define-key map "\e[12~" [f2])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
369 (define-key map "\e[13~" [f3])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
370 (define-key map "\e[14~" [f4])
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
371 map)
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
372 "Function key map overrides for xterm.")
61518
3e0057a2ce89 (function-key-map): Add mappings for A-, C-, S-
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61409
diff changeset
373
85107
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
374 (defvar xterm-alternatives-map
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
375 (let ((map (make-sparse-keymap)))
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
376 ;; The terminal initialization C code file might have initialized
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
377 ;; function keys F13->F60 from the termcap/terminfo information.
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
378 ;; On a PC-style keyboard these keys correspond to
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
379 ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The code
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
380 ;; here substitutes the corresponding definitions in function-key-map.
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
381 ;; The mapping from escape sequences to Fn is done in input-decode-map
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
382 ;; whereas this here mapping is done in local-function-key-map so that
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
383 ;; bindings to f45 still work, in case your keyboard really has an f45
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
384 ;; key rather than C-S-f9.
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
385 (define-key map [f13] [S-f1])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
386 (define-key map [f14] [S-f2])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
387 (define-key map [f15] [S-f3])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
388 (define-key map [f16] [S-f4])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
389 (define-key map [f17] [S-f5])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
390 (define-key map [f18] [S-f6])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
391 (define-key map [f19] [S-f7])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
392 (define-key map [f20] [S-f8])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
393 (define-key map [f21] [S-f9])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
394 (define-key map [f22] [S-f10])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
395 (define-key map [f23] [S-f11])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
396 (define-key map [f24] [S-f12])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
397
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
398 (define-key map [f25] [C-f1])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
399 (define-key map [f26] [C-f2])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
400 (define-key map [f27] [C-f3])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
401 (define-key map [f28] [C-f4])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
402 (define-key map [f29] [C-f5])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
403 (define-key map [f30] [C-f6])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
404 (define-key map [f31] [C-f7])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
405 (define-key map [f32] [C-f8])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
406 (define-key map [f33] [C-f9])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
407 (define-key map [f34] [C-f10])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
408 (define-key map [f35] [C-f11])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
409 (define-key map [f36] [C-f12])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
410
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
411 (define-key map [f37] [C-S-f1])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
412 (define-key map [f38] [C-S-f2])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
413 (define-key map [f39] [C-S-f3])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
414 (define-key map [f40] [C-S-f4])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
415 (define-key map [f41] [C-S-f5])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
416 (define-key map [f42] [C-S-f6])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
417 (define-key map [f43] [C-S-f7])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
418 (define-key map [f44] [C-S-f8])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
419 (define-key map [f45] [C-S-f9])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
420 (define-key map [f46] [C-S-f10])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
421 (define-key map [f47] [C-S-f11])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
422 (define-key map [f48] [C-S-f12])
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
423
85203
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
424 (define-key map [f49] [M-f1])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
425 (define-key map [f50] [M-f2])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
426 (define-key map [f51] [M-f3])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
427 (define-key map [f52] [M-f4])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
428 (define-key map [f53] [M-f5])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
429 (define-key map [f54] [M-f6])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
430 (define-key map [f55] [M-f7])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
431 (define-key map [f56] [M-f8])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
432 (define-key map [f57] [M-f9])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
433 (define-key map [f58] [M-f10])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
434 (define-key map [f59] [M-f11])
30c3da951eae (xterm-function-map, xterm-alternatives-map): Use the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85108
diff changeset
435 (define-key map [f60] [M-f12])
85107
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
436
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
437 map)
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
438 "Keymap of possible alternative meanings for some keys.")
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
439
83857
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
440 ;; List of terminals for which modify-other-keys has been turned on.
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
441 (defvar xterm-modify-other-keys-terminal-list nil)
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
442
64651
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
443 (defun terminal-init-xterm ()
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
444 "Terminal initialization function for xterm."
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
445 ;; rxvt terminals sometimes set the TERM variable to "xterm", but
83524
673d62ad74b5 Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents: 83517
diff changeset
446 ;; rxvt's keybindings are incompatible with xterm's. It is
64651
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
447 ;; better in that case to use rxvt's initializion function.
83594
2716535391b7 Rudimentary fix for environment variable handling.
Miles Bader <miles@gnu.org>
parents: 83561
diff changeset
448 (if (and (getenv "COLORTERM" (selected-frame))
2716535391b7 Rudimentary fix for environment variable handling.
Miles Bader <miles@gnu.org>
parents: 83561
diff changeset
449 (string-match "\\`rxvt" (getenv "COLORTERM" (selected-frame))))
83524
673d62ad74b5 Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents: 83517
diff changeset
450 (tty-run-terminal-initialization (selected-frame) "rxvt")
78765
a15fded14ec7 (terminal-init-xterm): Add bindings for M-S- and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78226
diff changeset
451
85107
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
452 (let ((map (copy-keymap xterm-alternatives-map)))
85108
589b4d30fe83 (xterm-alternatives-map): Remove spurious left-over code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85107
diff changeset
453 (set-keymap-parent map (keymap-parent local-function-key-map))
85107
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
454 (set-keymap-parent local-function-key-map map))
72312
fd4771b15a42 (terminal-init-xterm): Add more key bindings.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 72145
diff changeset
455
83638
38ddb24da427 (terminal-init-xterm): Fix previous change.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83636
diff changeset
456 (let ((map (copy-keymap xterm-function-map)))
65314
6c488c4c11c6 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64701
diff changeset
457
64651
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
458 ;; Use inheritance to let the main keymap override those defaults.
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
459 ;; This way we don't override terminfo-derived settings or settings
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
460 ;; made in the .emacs file.
85107
1d6428311f66 (xterm-alternatives-map): New map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 84570
diff changeset
461 (set-keymap-parent map (keymap-parent input-decode-map))
85108
589b4d30fe83 (xterm-alternatives-map): Remove spurious left-over code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85107
diff changeset
462 (set-keymap-parent input-decode-map map)))
64651
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
463
af1c58687bdd * term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents: 64597
diff changeset
464 (xterm-register-default-colors)
106973
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
465 (tty-set-up-initial-frame-faces)
106469
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
466
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
467 ;; Try to turn on the modifyOtherKeys feature on modern xterms.
85417
88baf5c3a196 Don't require xt-mouse.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85203
diff changeset
468 ;; When it is turned on many more key bindings work: things like
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
469 ;; C-. C-, etc.
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
470 ;; To do that we need to find out if the current terminal supports
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
471 ;; modifyOtherKeys. At this time only xterm does.
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
472 (let ((coding-system-for-read 'binary)
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
473 (chr nil)
106469
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
474 (str nil)
106973
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
475 (recompute-faces nil)
106469
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
476 version)
100259
fdc9da3de755 (terminal-init-xterm): Discard pending input before reading a reply to
Chong Yidong <cyd@stupidchicken.com>
parents: 98437
diff changeset
477 ;; Pending input can be mistakenly returned by the calls to
fdc9da3de755 (terminal-init-xterm): Discard pending input before reading a reply to
Chong Yidong <cyd@stupidchicken.com>
parents: 98437
diff changeset
478 ;; read-event below. Discard it.
fdc9da3de755 (terminal-init-xterm): Discard pending input before reading a reply to
Chong Yidong <cyd@stupidchicken.com>
parents: 98437
diff changeset
479 (discard-input)
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
480 ;; Try to find out the type of terminal by sending a "Secondary
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
481 ;; Device Attributes (DA)" query.
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
482 (send-string-to-terminal "\e[>0c")
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
483
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
484 ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c
85586
fbdae6f74bf5 (terminal-init-xterm): Experiment with a longer
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85417
diff changeset
485 ;; If the timeout is completely removed for read-event, this
fbdae6f74bf5 (terminal-init-xterm): Experiment with a longer
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85417
diff changeset
486 ;; might hang for terminals that pretend to be xterm, but don't
fbdae6f74bf5 (terminal-init-xterm): Experiment with a longer
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85417
diff changeset
487 ;; respond to this escape sequence. RMS' opinion was to remove
fbdae6f74bf5 (terminal-init-xterm): Experiment with a longer
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85417
diff changeset
488 ;; it completely. That might be right, but let's first try to
fbdae6f74bf5 (terminal-init-xterm): Experiment with a longer
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85417
diff changeset
489 ;; see if by using a longer timeout we get rid of most issues.
fbdae6f74bf5 (terminal-init-xterm): Experiment with a longer
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85417
diff changeset
490 (when (equal (read-event nil nil 2) ?\e)
fbdae6f74bf5 (terminal-init-xterm): Experiment with a longer
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85417
diff changeset
491 (when (equal (read-event nil nil 2) ?\[)
fbdae6f74bf5 (terminal-init-xterm): Experiment with a longer
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85417
diff changeset
492 (while (not (equal (setq chr (read-event nil nil 2)) ?c))
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
493 (setq str (concat str (string chr))))
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
494 (when (string-match ">0;\\([0-9]+\\);0" str)
106469
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
495 (setq version (string-to-number
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
496 (substring str (match-beginning 1) (match-end 1))))
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
497 ;; xterm version 242 supports reporting the background
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
498 ;; color, maybe earlier versions do too...
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
499 (when (>= version 242)
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
500 (send-string-to-terminal "\e]11;?\e\\")
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
501 (when (equal (read-event nil nil 2) ?\e)
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
502 (when (equal (read-event nil nil 2) ?\])
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
503 (setq str "")
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
504 (while (not (equal (setq chr (read-event nil nil 2)) ?\\))
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
505 (setq str (concat str (string chr))))
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
506 (when (string-match "11;rgb:\\([a-f0-9]+\\)/\\([a-f0-9]+\\)/\\([a-f0-9]+\\)" str)
106973
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
507 (setq recompute-faces
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
508 (xterm-maybe-set-dark-background-mode
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
509 (string-to-number (match-string 1 str) 16)
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
510 (string-to-number (match-string 2 str) 16)
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
511 (string-to-number (match-string 3 str) 16)))))))
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
512 ;; NUMBER2 is the xterm version number, look for something
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
513 ;; greater than 216, the version when modifyOtherKeys was
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
514 ;; introduced.
106469
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
515 (when (>= version 216)
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
516 ;; Make sure that the modifyOtherKeys state is restored when
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
517 ;; suspending, resuming and exiting.
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
518 (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys)
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
519 (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys)
83857
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
520 (add-hook 'kill-emacs-hook 'xterm-remove-modify-other-keys)
93370
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
521 (add-hook 'delete-terminal-functions 'xterm-remove-modify-other-keys)
83857
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
522 ;; Add the selected frame to the list of frames that
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
523 ;; need to deal with modify-other-keys.
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
524 (push (frame-terminal (selected-frame))
83857
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
525 xterm-modify-other-keys-terminal-list)
106973
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
526 (xterm-turn-on-modify-other-keys))
85417
88baf5c3a196 Don't require xt-mouse.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85203
diff changeset
527
106973
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
528 ;; Recompute faces here in case the background mode was
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
529 ;; set to dark. We used to call
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
530 ;; `tty-set-up-initial-frame-faces' only once, but that
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
531 ;; caused the light background faces to be computed
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
532 ;; incorrectly. See:
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
533 ;; http://permalink.gmane.org/gmane.emacs.devel/119627
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
534 (when recompute-faces
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
535 (tty-set-up-initial-frame-faces))))))
106469
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
536
85417
88baf5c3a196 Don't require xt-mouse.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85203
diff changeset
537 (run-hooks 'terminal-init-xterm-hook))
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 14170
diff changeset
538
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
539 ;; Set up colors, for those versions of xterm that support it.
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
540 (defvar xterm-standard-colors
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
541 ;; The names in the comments taken from XTerm-col.ad in the xterm
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
542 ;; distribution, see ftp://dickey.his.com/xterm/. RGB values are
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
543 ;; from rgb.txt.
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
544 '(("black" 0 ( 0 0 0)) ; black
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
545 ("red" 1 (205 0 0)) ; red3
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
546 ("green" 2 ( 0 205 0)) ; green3
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
547 ("yellow" 3 (205 205 0)) ; yellow3
61357
6596052b0a0d (xterm-standard-colors): Update color values from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 60935
diff changeset
548 ("blue" 4 ( 0 0 238)) ; blue2
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
549 ("magenta" 5 (205 0 205)) ; magenta3
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
550 ("cyan" 6 ( 0 205 205)) ; cyan3
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
551 ("white" 7 (229 229 229)) ; gray90
61357
6596052b0a0d (xterm-standard-colors): Update color values from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 60935
diff changeset
552 ("brightblack" 8 (127 127 127)) ; gray50
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
553 ("brightred" 9 (255 0 0)) ; red
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
554 ("brightgreen" 10 ( 0 255 0)) ; green
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
555 ("brightyellow" 11 (255 255 0)) ; yellow
61357
6596052b0a0d (xterm-standard-colors): Update color values from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 60935
diff changeset
556 ("brightblue" 12 (92 92 255)) ; rgb:5c/5c/ff
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
557 ("brightmagenta" 13 (255 0 255)) ; magenta
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
558 ("brightcyan" 14 ( 0 255 255)) ; cyan
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
559 ("brightwhite" 15 (255 255 255))) ; white
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
560 "Names of 16 standard xterm/aixterm colors, their numbers, and RGB values.")
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
561
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
562 (defun xterm-rgb-convert-to-16bit (prim)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
563 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
61409
6550784a652a (xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61357
diff changeset
564 (logior prim (lsh prim 8)))
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
565
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
566 (defun xterm-register-default-colors ()
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
567 "Register the default set of colors for xterm or compatible emulator.
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
568
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
569 This function registers the number of colors returned by `display-color-cells'
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
570 for the currently selected frame. The first 16 colors are taken from
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
571 `xterm-standard-colors', which see, while the rest are computed assuming
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
572 either the 88- or 256-color standard color scheme supported by latest
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
573 versions of xterm."
83008
040dd41ed7d0 Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 52401
diff changeset
574 (let* ((ncolors (display-color-cells (selected-frame)))
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
575 (colors xterm-standard-colors)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
576 (color (car colors)))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
577 (if (> ncolors 0)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
578 ;; Clear the 8 default tty colors registered by startup.el
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
579 (tty-color-clear))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
580 ;; Only register as many colors as are supported by the display.
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
581 (while (and (> ncolors 0) colors)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
582 (tty-color-define (car color) (cadr color)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
583 (mapcar 'xterm-rgb-convert-to-16bit
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
584 (car (cddr color))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
585 (setq colors (cdr colors)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
586 color (car colors)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
587 ncolors (1- ncolors)))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
588 ;; We've exhausted the colors from `xterm-standard-colors'. If there
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
589 ;; are more colors to support, compute them now.
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
590 (when (> ncolors 0)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
591 (cond
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
592 ((= ncolors 240) ; 256-color xterm
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
593 ;; 216 non-gray colors first
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
594 (let ((r 0) (g 0) (b 0))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
595 (while (> ncolors 24)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
596 ;; This and other formulae taken from 256colres.pl and
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
597 ;; 88colres.pl in the xterm distribution.
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
598 (tty-color-define (format "color-%d" (- 256 ncolors))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
599 (- 256 ncolors)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
600 (mapcar 'xterm-rgb-convert-to-16bit
61409
6550784a652a (xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61357
diff changeset
601 (list (if (zerop r) 0 (+ (* r 40) 55))
6550784a652a (xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61357
diff changeset
602 (if (zerop g) 0 (+ (* g 40) 55))
6550784a652a (xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61357
diff changeset
603 (if (zerop b) 0 (+ (* b 40) 55)))))
6550784a652a (xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61357
diff changeset
604
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
605 (setq b (1+ b))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
606 (if (> b 5)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
607 (setq g (1+ g)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
608 b 0))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
609 (if (> g 5)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
610 (setq r (1+ r)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
611 g 0))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
612 (setq ncolors (1- ncolors))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
613 ;; Now the 24 gray colors
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
614 (while (> ncolors 0)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
615 (setq color (xterm-rgb-convert-to-16bit (+ 8 (* (- 24 ncolors) 10))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
616 (tty-color-define (format "color-%d" (- 256 ncolors))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
617 (- 256 ncolors)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
618 (list color color color))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
619 (setq ncolors (1- ncolors))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
620 ((= ncolors 72) ; 88-color xterm
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
621 ;; 64 non-gray colors
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
622 (let ((levels '(0 139 205 255))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
623 (r 0) (g 0) (b 0))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
624 (while (> ncolors 8)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
625 (tty-color-define (format "color-%d" (- 88 ncolors))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
626 (- 88 ncolors)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
627 (mapcar 'xterm-rgb-convert-to-16bit
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
628 (list (nth r levels)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
629 (nth g levels)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
630 (nth b levels))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
631 (setq b (1+ b))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
632 (if (> b 3)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
633 (setq g (1+ g)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
634 b 0))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
635 (if (> g 3)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
636 (setq r (1+ r)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
637 g 0))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
638 (setq ncolors (1- ncolors))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
639 ;; Now the 8 gray colors
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
640 (while (> ncolors 0)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
641 (setq color (xterm-rgb-convert-to-16bit
61409
6550784a652a (xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 61357
diff changeset
642 (floor
42947
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
643 (if (= ncolors 8)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
644 46.36363636
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
645 (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
646 (tty-color-define (format "color-%d" (- 88 ncolors))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
647 (- 88 ncolors)
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
648 (list color color color))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
649 (setq ncolors (1- ncolors))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
650 (t (error "Unsupported number of xterm colors (%d)" (+ 16 ncolors)))))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
651 ;; Modifying color mappings means realized faces don't use the
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
652 ;; right colors, so clear them.
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
653 (clear-face-cache)))
76e795715361 (xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents: 40694
diff changeset
654
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
655 (defun xterm-turn-on-modify-other-keys ()
98437
d35e240a4622 (xterm-turn-on-modify-other-keys)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94671
diff changeset
656 "Turn the modifyOtherKeys feature of xterm back on."
93370
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
657 (let ((terminal (frame-terminal (selected-frame))))
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
658 (when (and (terminal-live-p terminal)
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
659 (memq terminal xterm-modify-other-keys-terminal-list))
98437
d35e240a4622 (xterm-turn-on-modify-other-keys)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94671
diff changeset
660 (send-string-to-terminal "\e[>4;1m" terminal))))
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
661
83857
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
662 (defun xterm-turn-off-modify-other-keys (&optional frame)
98437
d35e240a4622 (xterm-turn-on-modify-other-keys)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94671
diff changeset
663 "Temporarily turn off the modifyOtherKeys feature of xterm."
93370
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
664 (let ((terminal (when frame (frame-terminal frame))))
98437
d35e240a4622 (xterm-turn-on-modify-other-keys)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94671
diff changeset
665 (when (and (terminal-live-p terminal)
93370
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
666 (memq terminal xterm-modify-other-keys-terminal-list))
98437
d35e240a4622 (xterm-turn-on-modify-other-keys)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94671
diff changeset
667 (send-string-to-terminal "\e[>4m" terminal))))
83857
110830e39714 (xterm-modify-other-keys-terminal-list): New
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83648
diff changeset
668
93370
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
669 (defun xterm-remove-modify-other-keys (&optional terminal)
98437
d35e240a4622 (xterm-turn-on-modify-other-keys)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94671
diff changeset
670 "Turn off the modifyOtherKeys feature of xterm for good."
100320
e11ed8333674 (xterm-remove-modify-other-keys): Fix error in terminal variable
Chong Yidong <cyd@stupidchicken.com>
parents: 100259
diff changeset
671 (setq terminal (or terminal (frame-terminal (selected-frame))))
93370
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
672 (when (and (terminal-live-p terminal)
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
673 (memq terminal xterm-modify-other-keys-terminal-list))
84379
93833f201e31 (xterm-function-map): Initialize in the declaration.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83857
diff changeset
674 (setq xterm-modify-other-keys-terminal-list
93370
eaf6138f43e7 (terminal-init-xterm): Use delete-terminal-functions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92790
diff changeset
675 (delq terminal xterm-modify-other-keys-terminal-list))
98437
d35e240a4622 (xterm-turn-on-modify-other-keys)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94671
diff changeset
676 (send-string-to-terminal "\e[>4m" terminal)))
81901
7e6412eabecf (xterm-turn-on-modify-other-keys)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78005
diff changeset
677
106973
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
678 (defun xterm-maybe-set-dark-background-mode (redc greenc bluec)
106469
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
679 ;; Use the heuristic in `frame-set-background-mode' to decide if a
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
680 ;; frame is dark.
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
681 (when (< (+ redc greenc bluec) (* .6 (+ 65535 65535 65535)))
106973
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
682 (set-terminal-parameter nil 'background-mode 'dark)
9b98e092d459 (xterm-maybe-set-dark-background-mode): Rename
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
683 t))
106469
ad4147368f52 Get the background mode from the terminal for xterm, and set
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
684
56979
f0f48b9999fa (function-key-map): Add bindings for C- and S- cursor
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
685 ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 14170
diff changeset
686 ;;; xterm.el ends here