Mercurial > emacs
annotate lisp/term/xterm.el @ 83421:bb2edc915032
Implement automatic terminal-local environment variables via `local-environment-variables'.
* lisp/env.el (setenv, getenv): Add optional terminal parameter. Update docs.
(setenv): Handle `local-environment-variables'.
(read-envvar-name): Also allow (and complete) local
environment variables on the current terminal.
* src/callproc.c: Include frame.h and termhooks.h, for terminal parameters.
(Qenvironment): New constant.
(Vlocal_environment_variables): New variable.
(syms_of_callproc): Register and initialize them.
(child_setup): Handle Vlocal_environment_variables.
(getenv_internal): Add terminal parameter. Handle
Vlocal_environment_variables.
(Fgetenv_internal): Add terminal parameter.
* src/termhooks.h (get_terminal_param): Declare.
* src/Makefile.in (callproc.o): Update dependencies.
* mac/makefile.MPW (callproc.c.x): Update dependencies.
* lisp/termdev.el (terminal-id): Make parameter optional.
(terminal-getenv, terminal-setenv, with-terminal-environment):
Disable functions.
* lisp/mule-cmds.el (set-locale-environment): Convert `terminal-getenv' calls
to `getenv'.
* lisp/rxvt.el (rxvt-set-background-mode): Ditto.
* lisp/x-win.el (x-initialize-window-system): Ditto.
* lisp/xterm.el (terminal-init-xterm): Ditto.
* lisp/server.el (server-process-filter): Fix reference to the 'display frame
parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-461
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 26 Dec 2005 02:14:10 +0000 |
parents | 51eb0aa362f3 |
children | b98066f4aa10 |
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 | 2 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64651
diff
changeset
|
3 ;; Copyright (C) 1995, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
4 |
12159 | 5 ;; Author: FSF |
6 ;; Keywords: terminals | |
7 | |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
9 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
10 ;; GNU Emacs is free software; you can redistribute it and/or modify |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
13 ;; any later version. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
14 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
15 ;; 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
|
16 ;; 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
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
18 ;; GNU General Public License for more details. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
19 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
12159
diff
changeset
|
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64084 | 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 ;; Boston, MA 02110-1301, USA. | |
12159 | 24 |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14170
diff
changeset
|
25 ;;; Commentary: |
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14170
diff
changeset
|
26 |
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14170
diff
changeset
|
27 ;;; Code: |
12159 | 28 |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
29 (defvar xterm-function-map nil |
83297
8e357d90cc9f
Fix exponential slowdowns on repeated tty frame creation.
Karoly Lorentey <lorentey@elte.hu>
parents:
83295
diff
changeset
|
30 "Function key map overrides for xterm.") |
61977
4039ddc27a88
(function-key-map): Call substitute-key-definition
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61842
diff
changeset
|
31 |
83316
102194c6d773
Update Lisp code for a terminal-local `function-key-map'.
Karoly Lorentey <lorentey@elte.hu>
parents:
83305
diff
changeset
|
32 ;; Make reloads faster. |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
33 (unless xterm-function-map |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
34 (setq xterm-function-map (make-sparse-keymap)) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
35 ;; xterm from X.org 6.8.2 uses these key definitions. |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
36 (define-key xterm-function-map "\eOP" [f1]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
37 (define-key xterm-function-map "\eOQ" [f2]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
38 (define-key xterm-function-map "\eOR" [f3]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
39 (define-key xterm-function-map "\eOS" [f4]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
40 (define-key xterm-function-map "\e[15~" [f5]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
41 (define-key xterm-function-map "\e[17~" [f6]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
42 (define-key xterm-function-map "\e[18~" [f7]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
43 (define-key xterm-function-map "\e[19~" [f8]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
44 (define-key xterm-function-map "\e[20~" [f9]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
45 (define-key xterm-function-map "\e[21~" [f10]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
46 (define-key xterm-function-map "\e[23~" [f11]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
47 (define-key xterm-function-map "\e[24~" [f12]) |
61977
4039ddc27a88
(function-key-map): Call substitute-key-definition
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61842
diff
changeset
|
48 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
49 (define-key xterm-function-map "\eO2P" [S-f1]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
50 (define-key xterm-function-map "\eO2Q" [S-f2]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
51 (define-key xterm-function-map "\eO2R" [S-f3]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
52 (define-key xterm-function-map "\eO2S" [S-f4]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
53 (define-key xterm-function-map "\e[15;2~" [S-f5]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
54 (define-key xterm-function-map "\e[17;2~" [S-f6]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
55 (define-key xterm-function-map "\e[18;2~" [S-f7]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
56 (define-key xterm-function-map "\e[19;2~" [S-f8]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
57 (define-key xterm-function-map "\e[20;2~" [S-f9]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
58 (define-key xterm-function-map "\e[21;2~" [S-f10]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
59 (define-key xterm-function-map "\e[23;2~" [S-f11]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
60 (define-key xterm-function-map "\e[24;2~" [S-f12]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
61 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
62 (define-key xterm-function-map "\eO5P" [C-f1]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
63 (define-key xterm-function-map "\eO5Q" [C-f2]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
64 (define-key xterm-function-map "\eO5R" [C-f3]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
65 (define-key xterm-function-map "\eO5S" [C-f4]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
66 (define-key xterm-function-map "\e[15;5~" [C-f5]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
67 (define-key xterm-function-map "\e[17;5~" [C-f6]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
68 (define-key xterm-function-map "\e[18;5~" [C-f7]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
69 (define-key xterm-function-map "\e[19;5~" [C-f8]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
70 (define-key xterm-function-map "\e[20;5~" [C-f9]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
71 (define-key xterm-function-map "\e[21;5~" [C-f10]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
72 (define-key xterm-function-map "\e[23;5~" [C-f11]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
73 (define-key xterm-function-map "\e[24;5~" [C-f12]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
74 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
75 (define-key xterm-function-map "\eO6P" [C-S-f1]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
76 (define-key xterm-function-map "\eO6Q" [C-S-f2]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
77 (define-key xterm-function-map "\eO6R" [C-S-f3]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
78 (define-key xterm-function-map "\eO6S" [C-S-f4]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
79 (define-key xterm-function-map "\e[15;6~" [C-S-f5]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
80 (define-key xterm-function-map "\e[17;6~" [C-S-f6]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
81 (define-key xterm-function-map "\e[18;6~" [C-S-f7]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
82 (define-key xterm-function-map "\e[19;6~" [C-S-f8]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
83 (define-key xterm-function-map "\e[20;6~" [C-S-f9]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
84 (define-key xterm-function-map "\e[21;6~" [C-S-f10]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
85 (define-key xterm-function-map "\e[23;6~" [C-S-f11]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
86 (define-key xterm-function-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>
diff
changeset
|
87 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
88 (define-key xterm-function-map "\eO3P" [A-f1]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
89 (define-key xterm-function-map "\eO3Q" [A-f2]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
90 (define-key xterm-function-map "\eO3R" [A-f3]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
91 (define-key xterm-function-map "\eO3S" [A-f4]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
92 (define-key xterm-function-map "\e[15;3~" [A-f5]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
93 (define-key xterm-function-map "\e[17;3~" [A-f6]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
94 (define-key xterm-function-map "\e[18;3~" [A-f7]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
95 (define-key xterm-function-map "\e[19;3~" [A-f8]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
96 (define-key xterm-function-map "\e[20;3~" [A-f9]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
97 (define-key xterm-function-map "\e[21;3~" [A-f10]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
98 (define-key xterm-function-map "\e[23;3~" [A-f11]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
99 (define-key xterm-function-map "\e[24;3~" [A-f12]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
100 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
101 (define-key xterm-function-map "\eOA" [up]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
102 (define-key xterm-function-map "\eOB" [down]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
103 (define-key xterm-function-map "\eOC" [right]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
104 (define-key xterm-function-map "\eOD" [left]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
105 (define-key xterm-function-map "\eOF" [end]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
106 (define-key xterm-function-map "\eOH" [home]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
107 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
108 (define-key xterm-function-map "\e[1;2A" [S-up]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
109 (define-key xterm-function-map "\e[1;2B" [S-down]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
110 (define-key xterm-function-map "\e[1;2C" [S-right]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
111 (define-key xterm-function-map "\e[1;2D" [S-left]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
112 (define-key xterm-function-map "\e[1;2F" [S-end]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
113 (define-key xterm-function-map "\e[1;2H" [S-home]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
114 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
115 (define-key xterm-function-map "\e[1;5A" [C-up]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
116 (define-key xterm-function-map "\e[1;5B" [C-down]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
117 (define-key xterm-function-map "\e[1;5C" [C-right]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
118 (define-key xterm-function-map "\e[1;5D" [C-left]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
119 (define-key xterm-function-map "\e[1;5F" [C-end]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
120 (define-key xterm-function-map "\e[1;5H" [C-home]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
121 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
122 (define-key xterm-function-map "\e[1;6A" [C-S-up]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
123 (define-key xterm-function-map "\e[1;6B" [C-S-down]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
124 (define-key xterm-function-map "\e[1;6C" [C-S-right]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
125 (define-key xterm-function-map "\e[1;6D" [C-S-left]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
126 (define-key xterm-function-map "\e[1;6F" [C-S-end]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
127 (define-key xterm-function-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>
diff
changeset
|
128 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
129 (define-key xterm-function-map "\e[1;3A" [A-up]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
130 (define-key xterm-function-map "\e[1;3B" [A-down]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
131 (define-key xterm-function-map "\e[1;3C" [A-right]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
132 (define-key xterm-function-map "\e[1;3D" [A-left]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
133 (define-key xterm-function-map "\e[1;3F" [A-end]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
134 (define-key xterm-function-map "\e[1;3H" [A-home]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
135 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
136 (define-key xterm-function-map "\e[2~" [insert]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
137 (define-key xterm-function-map "\e[3~" [delete]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
138 (define-key xterm-function-map "\e[5~" [prior]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
139 (define-key xterm-function-map "\e[6~" [next]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
140 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
141 (define-key xterm-function-map "\e[2;2~" [S-insert]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
142 (define-key xterm-function-map "\e[3;2~" [S-delete]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
143 (define-key xterm-function-map "\e[5;2~" [S-prior]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
144 (define-key xterm-function-map "\e[6;2~" [S-next]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
145 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
146 (define-key xterm-function-map "\e[2;5~" [C-insert]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
147 (define-key xterm-function-map "\e[3;5~" [C-delete]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
148 (define-key xterm-function-map "\e[5;5~" [C-prior]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
149 (define-key xterm-function-map "\e[6;5~" [C-next]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
150 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
151 (define-key xterm-function-map "\e[2;6~" [C-S-insert]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
152 (define-key xterm-function-map "\e[3;6~" [C-S-delete]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
153 (define-key xterm-function-map "\e[5;6~" [C-S-prior]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
154 (define-key xterm-function-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>
diff
changeset
|
155 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
156 (define-key xterm-function-map "\e[2;3~" [A-insert]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
157 (define-key xterm-function-map "\e[3;3~" [A-delete]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
158 (define-key xterm-function-map "\e[5;3~" [A-prior]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
159 (define-key xterm-function-map "\e[6;3~" [A-next]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
160 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
161 (define-key xterm-function-map "\e[4~" [select]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
162 (define-key xterm-function-map "\e[29~" [print]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
163 |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
164 ;; Other versions of xterm might emit these. |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
165 (define-key xterm-function-map "\e[A" [up]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
166 (define-key xterm-function-map "\e[B" [down]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
167 (define-key xterm-function-map "\e[C" [right]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
168 (define-key xterm-function-map "\e[D" [left]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
169 (define-key xterm-function-map "\e[1~" [home]) |
61518
3e0057a2ce89
(function-key-map): Add mappings for A-, C-, S-
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61409
diff
changeset
|
170 |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
171 (define-key xterm-function-map "\e[1;2A" [S-up]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
172 (define-key xterm-function-map "\e[1;2B" [S-down]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
173 (define-key xterm-function-map "\e[1;2C" [S-right]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
174 (define-key xterm-function-map "\e[1;2D" [S-left]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
175 (define-key xterm-function-map "\e[1;2F" [S-end]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
176 (define-key xterm-function-map "\e[1;2H" [S-home]) |
56979
f0f48b9999fa
(function-key-map): Add bindings for C- and S- cursor
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52401
diff
changeset
|
177 |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
178 (define-key xterm-function-map "\e[1;5A" [C-up]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
179 (define-key xterm-function-map "\e[1;5B" [C-down]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
180 (define-key xterm-function-map "\e[1;5C" [C-right]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
181 (define-key xterm-function-map "\e[1;5D" [C-left]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
182 (define-key xterm-function-map "\e[1;5F" [C-end]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83304
diff
changeset
|
183 (define-key xterm-function-map "\e[1;5H" [C-home]) |
61518
3e0057a2ce89
(function-key-map): Add mappings for A-, C-, S-
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61409
diff
changeset
|
184 |
83354
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
185 (define-key xterm-function-map "\e[11~" [f1]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
186 (define-key xterm-function-map "\e[12~" [f2]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
187 (define-key xterm-function-map "\e[13~" [f3]) |
e506a3d30e62
Fix syntax error in lisp/term/xterm.el.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
188 (define-key xterm-function-map "\e[14~" [f4])) |
61518
3e0057a2ce89
(function-key-map): Add mappings for A-, C-, S-
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61409
diff
changeset
|
189 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
190 (defun terminal-init-xterm () |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
191 "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
|
192 ;; rxvt terminals sometimes set the TERM variable to "xterm", but |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
193 ;; rxvt's keybindings that are incompatible with xterm's. It is |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
194 ;; better in that case to use rxvt's initializion function. |
83421
bb2edc915032
Implement automatic terminal-local environment variables via `local-environment-variables'.
Karoly Lorentey <lorentey@elte.hu>
parents:
83403
diff
changeset
|
195 (if (and (getenv "COLORTERM" (terminal-id)) |
bb2edc915032
Implement automatic terminal-local environment variables via `local-environment-variables'.
Karoly Lorentey <lorentey@elte.hu>
parents:
83403
diff
changeset
|
196 (string-match "\\`rxvt" (getenv "COLORTERM" (terminal-id)))) |
83361
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
197 (progn |
65642
abfd35943fc4
(terminal-init-xterm): Fix loading rxvt at run
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65314
diff
changeset
|
198 (eval-and-compile (load "term/rxvt")) |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
199 (terminal-init-rxvt)) |
64597
79fcb8ba32de
Load term/rxvt if the terminal is actually an
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
200 |
83361
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
201 ;; The terminal-local stuff only need to be set up on the first |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
202 ;; frame on that device. |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
203 (when (eq 1 (length (frames-on-display-list))) |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
204 ;; The terminal intialization C code file might have initialized |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
205 ;; function keys F13->F60 from the termcap/terminfo information. On |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
206 ;; a PC-style keyboard these keys correspond to |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
207 ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
208 ;; code here subsitutes the corresponding defintions in |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
209 ;; function-key-map. This substitution is needed because if a key |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
210 ;; definition if found in function-key-map, there are no further |
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
211 ;; lookups in other keymaps. |
83394
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
212 (substitute-key-definition [f13] [S-f1] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
213 (substitute-key-definition [f14] [S-f2] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
214 (substitute-key-definition [f15] [S-f3] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
215 (substitute-key-definition [f16] [S-f4] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
216 (substitute-key-definition [f17] [S-f5] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
217 (substitute-key-definition [f18] [S-f6] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
218 (substitute-key-definition [f19] [S-f7] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
219 (substitute-key-definition [f20] [S-f8] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
220 (substitute-key-definition [f21] [S-f9] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
221 (substitute-key-definition [f22] [S-f10] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
222 (substitute-key-definition [f23] [S-f11] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
223 (substitute-key-definition [f24] [S-f12] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
224 |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
225 (substitute-key-definition [f25] [C-f1] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
226 (substitute-key-definition [f26] [C-f2] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
227 (substitute-key-definition [f27] [C-f3] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
228 (substitute-key-definition [f28] [C-f4] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
229 (substitute-key-definition [f29] [C-f5] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
230 (substitute-key-definition [f30] [C-f6] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
231 (substitute-key-definition [f31] [C-f7] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
232 (substitute-key-definition [f32] [C-f8] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
233 (substitute-key-definition [f33] [C-f9] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
234 (substitute-key-definition [f34] [C-f10] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
235 (substitute-key-definition [f35] [C-f11] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
236 (substitute-key-definition [f36] [C-f12] local-function-key-map) |
61518
3e0057a2ce89
(function-key-map): Add mappings for A-, C-, S-
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61409
diff
changeset
|
237 |
83394
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
238 (substitute-key-definition [f37] [C-S-f1] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
239 (substitute-key-definition [f38] [C-S-f2] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
240 (substitute-key-definition [f39] [C-S-f3] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
241 (substitute-key-definition [f40] [C-S-f4] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
242 (substitute-key-definition [f41] [C-S-f5] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
243 (substitute-key-definition [f42] [C-S-f6] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
244 (substitute-key-definition [f43] [C-S-f7] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
245 (substitute-key-definition [f44] [C-S-f8] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
246 (substitute-key-definition [f45] [C-S-f9] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
247 (substitute-key-definition [f46] [C-S-f10] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
248 (substitute-key-definition [f47] [C-S-f11] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
249 (substitute-key-definition [f48] [C-S-f12] local-function-key-map) |
61518
3e0057a2ce89
(function-key-map): Add mappings for A-, C-, S-
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61409
diff
changeset
|
250 |
83394
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
251 (substitute-key-definition [f49] [A-f1] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
252 (substitute-key-definition [f50] [A-f2] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
253 (substitute-key-definition [f51] [A-f3] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
254 (substitute-key-definition [f52] [A-f4] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
255 (substitute-key-definition [f53] [A-f5] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
256 (substitute-key-definition [f54] [A-f6] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
257 (substitute-key-definition [f55] [A-f7] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
258 (substitute-key-definition [f56] [A-f8] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
259 (substitute-key-definition [f57] [A-f9] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
260 (substitute-key-definition [f58] [A-f10] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
261 (substitute-key-definition [f59] [A-f11] local-function-key-map) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
262 (substitute-key-definition [f60] [A-f12] local-function-key-map)) |
65314
6c488c4c11c6
* term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64701
diff
changeset
|
263 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
264 ;; 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
|
265 ;; 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
|
266 ;; made in the .emacs file. |
83361
39de99cd3f08
Prevent resource allocation explosion when C-x 5 2 is used on xterms.
Karoly Lorentey <lorentey@elte.hu>
parents:
83354
diff
changeset
|
267 (let ((m (copy-keymap xterm-function-map))) |
83394
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
268 (set-keymap-parent m (keymap-parent local-function-key-map)) |
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
269 (set-keymap-parent local-function-key-map m))) |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
270 |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
271 ;; Do it! |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
272 (xterm-register-default-colors) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64597
diff
changeset
|
273 ;; This recomputes all the default faces given the colors we've just set up. |
83394
7d093d9d4479
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack.
Karoly Lorentey <lorentey@elte.hu>
parents:
83383
diff
changeset
|
274 (tty-set-up-initial-frame-faces)) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14170
diff
changeset
|
275 |
42947
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
276 ;; 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
|
277 (defvar xterm-standard-colors |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
278 ;; 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
|
279 ;; 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
|
280 ;; from rgb.txt. |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
281 '(("black" 0 ( 0 0 0)) ; black |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
282 ("red" 1 (205 0 0)) ; red3 |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
283 ("green" 2 ( 0 205 0)) ; green3 |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
284 ("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
|
285 ("blue" 4 ( 0 0 238)) ; blue2 |
42947
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
286 ("magenta" 5 (205 0 205)) ; magenta3 |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
287 ("cyan" 6 ( 0 205 205)) ; cyan3 |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
288 ("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
|
289 ("brightblack" 8 (127 127 127)) ; gray50 |
42947
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
290 ("brightred" 9 (255 0 0)) ; red |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
291 ("brightgreen" 10 ( 0 255 0)) ; green |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
292 ("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
|
293 ("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
|
294 ("brightmagenta" 13 (255 0 255)) ; magenta |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
295 ("brightcyan" 14 ( 0 255 255)) ; cyan |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
296 ("brightwhite" 15 (255 255 255))) ; white |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
297 "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
|
298 |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
299 (defun xterm-rgb-convert-to-16bit (prim) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
300 "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
|
301 (logior prim (lsh prim 8))) |
42947
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
302 |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
303 (defun xterm-register-default-colors () |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
304 "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
|
305 |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
306 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
|
307 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
|
308 `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
|
309 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
|
310 versions of xterm." |
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
52401
diff
changeset
|
311 (let* ((ncolors (display-color-cells (selected-frame))) |
42947
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
312 (colors xterm-standard-colors) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
313 (color (car colors))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
314 (if (> ncolors 0) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
315 ;; 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
|
316 (tty-color-clear)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
317 ;; 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
|
318 (while (and (> ncolors 0) colors) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
319 (tty-color-define (car color) (cadr color) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
320 (mapcar 'xterm-rgb-convert-to-16bit |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
321 (car (cddr color)))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
322 (setq colors (cdr colors) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
323 color (car colors) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
324 ncolors (1- ncolors))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
325 ;; 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
|
326 ;; are more colors to support, compute them now. |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
327 (when (> ncolors 0) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
328 (cond |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
329 ((= ncolors 240) ; 256-color xterm |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
330 ;; 216 non-gray colors first |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
331 (let ((r 0) (g 0) (b 0)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
332 (while (> ncolors 24) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
333 ;; This and other formulae taken from 256colres.pl and |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
334 ;; 88colres.pl in the xterm distribution. |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
335 (tty-color-define (format "color-%d" (- 256 ncolors)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
336 (- 256 ncolors) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
337 (mapcar 'xterm-rgb-convert-to-16bit |
61409
6550784a652a
(xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61357
diff
changeset
|
338 (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
|
339 (if (zerop g) 0 (+ (* g 40) 55)) |
6550784a652a
(xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61357
diff
changeset
|
340 (if (zerop b) 0 (+ (* b 40) 55))))) |
6550784a652a
(xterm-rgb-convert-to-16bit): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61357
diff
changeset
|
341 |
42947
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
342 (setq b (1+ b)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
343 (if (> b 5) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
344 (setq g (1+ g) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
345 b 0)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
346 (if (> g 5) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
347 (setq r (1+ r) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
348 g 0)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
349 (setq ncolors (1- ncolors)))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
350 ;; Now the 24 gray colors |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
351 (while (> ncolors 0) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
352 (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
|
353 (tty-color-define (format "color-%d" (- 256 ncolors)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
354 (- 256 ncolors) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
355 (list color color color)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
356 (setq ncolors (1- ncolors)))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
357 ((= ncolors 72) ; 88-color xterm |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
358 ;; 64 non-gray colors |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
359 (let ((levels '(0 139 205 255)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
360 (r 0) (g 0) (b 0)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
361 (while (> ncolors 8) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
362 (tty-color-define (format "color-%d" (- 88 ncolors)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
363 (- 88 ncolors) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
364 (mapcar 'xterm-rgb-convert-to-16bit |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
365 (list (nth r levels) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
366 (nth g levels) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
367 (nth b levels)))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
368 (setq b (1+ b)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
369 (if (> b 3) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
370 (setq g (1+ g) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
371 b 0)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
372 (if (> g 3) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
373 (setq r (1+ r) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
374 g 0)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
375 (setq ncolors (1- ncolors)))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
376 ;; Now the 8 gray colors |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
377 (while (> ncolors 0) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
378 (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
|
379 (floor |
42947
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
380 (if (= ncolors 8) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
381 46.36363636 |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
382 (+ (* (- 8 ncolors) 23.18181818) 69.54545454))))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
383 (tty-color-define (format "color-%d" (- 88 ncolors)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
384 (- 88 ncolors) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
385 (list color color color)) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
386 (setq ncolors (1- ncolors)))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
387 (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
|
388 ;; 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
|
389 ;; right colors, so clear them. |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
390 (clear-face-cache))) |
76e795715361
(xterm-standard-colors): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
40694
diff
changeset
|
391 |
56979
f0f48b9999fa
(function-key-map): Add bindings for C- and S- cursor
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52401
diff
changeset
|
392 ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14170
diff
changeset
|
393 ;;; xterm.el ends here |