Mercurial > emacs
annotate lisp/term/rxvt.el @ 84080:d32aa3b647f3
Move here from ../../lispref
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 06 Sep 2007 04:21:18 +0000 |
parents | 65663fcd2caa |
children | 83341575ba12 |
rev | line source |
---|---|
42945 | 1 ;;; rxvt.el --- define function key sequences and standard colors for rxvt |
2 | |
75347 | 3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
42945 | 4 |
5 ;; Author: Eli Zaretskii | |
6 ;; Keywords: terminals | |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
78226
030ae62d5c57
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
12 ;; the Free Software Foundation; either version 3, or (at your option) |
42945 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
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. | |
42945 | 24 |
25 ;;; Commentary: | |
26 | |
27 ;;; Code: | |
28 | |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
29 (defvar rxvt-function-map (make-sparse-keymap) |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
30 "Function key overrides for rxvt.") |
64596
d5254bde5ea5
* term/rxvt.el (function-key-map): Use substitute-key-definition
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
31 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
32 ;; Set up function-key-map entries that termcap and terminfo don't know. |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
33 (define-key rxvt-function-map "\e[A" [up]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
34 (define-key rxvt-function-map "\e[B" [down]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
35 (define-key rxvt-function-map "\e[C" [right]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
36 (define-key rxvt-function-map "\e[D" [left]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
37 (define-key rxvt-function-map "\e[2~" [insert]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
38 (define-key rxvt-function-map "\e[3~" [delete]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
39 (define-key rxvt-function-map "\e[4~" [select]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
40 (define-key rxvt-function-map "\e[5~" [prior]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
41 (define-key rxvt-function-map "\e[6~" [next]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
42 (define-key rxvt-function-map "\e[7~" [home]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
43 (define-key rxvt-function-map "\e[8~" [end]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
44 (define-key rxvt-function-map "\e[11~" [f1]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
45 (define-key rxvt-function-map "\e[12~" [f2]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
46 (define-key rxvt-function-map "\e[13~" [f3]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
47 (define-key rxvt-function-map "\e[14~" [f4]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
48 (define-key rxvt-function-map "\e[15~" [f5]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
49 (define-key rxvt-function-map "\e[17~" [f6]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
50 (define-key rxvt-function-map "\e[18~" [f7]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
51 (define-key rxvt-function-map "\e[19~" [f8]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
52 (define-key rxvt-function-map "\e[20~" [f9]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
53 (define-key rxvt-function-map "\e[21~" [f10]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
54 ;; The strings emitted by f11 and f12 are the same as the strings |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
55 ;; emitted by S-f1 and S-f2, so don't define f11 and f12. |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
56 ;; (define-key rxvt-function-map "\e[23~" [f11]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
57 ;; (define-key rxvt-function-map "\e[24~" [f12]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
58 (define-key rxvt-function-map "\e[29~" [print]) |
64596
d5254bde5ea5
* term/rxvt.el (function-key-map): Use substitute-key-definition
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
59 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
60 (define-key rxvt-function-map "\e[11^" [C-f1]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
61 (define-key rxvt-function-map "\e[12^" [C-f2]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
62 (define-key rxvt-function-map "\e[13^" [C-f3]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
63 (define-key rxvt-function-map "\e[14^" [C-f4]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
64 (define-key rxvt-function-map "\e[15^" [C-f5]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
65 (define-key rxvt-function-map "\e[17^" [C-f6]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
66 (define-key rxvt-function-map "\e[18^" [C-f7]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
67 (define-key rxvt-function-map "\e[19^" [C-f8]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
68 (define-key rxvt-function-map "\e[20^" [C-f9]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
69 (define-key rxvt-function-map "\e[21^" [C-f10]) |
42945 | 70 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
71 (define-key rxvt-function-map "\e[23~" [S-f1]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
72 (define-key rxvt-function-map "\e[24~" [S-f2]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
73 (define-key rxvt-function-map "\e[25~" [S-f3]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
74 (define-key rxvt-function-map "\e[26~" [S-f4]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
75 (define-key rxvt-function-map "\e[28~" [S-f5]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
76 (define-key rxvt-function-map "\e[29~" [S-f6]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
77 (define-key rxvt-function-map "\e[31~" [S-f7]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
78 (define-key rxvt-function-map "\e[32~" [S-f8]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
79 (define-key rxvt-function-map "\e[33~" [S-f9]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
80 (define-key rxvt-function-map "\e[34~" [S-f10]) |
42945 | 81 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
82 (define-key rxvt-function-map "\e[23^" [C-S-f1]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
83 (define-key rxvt-function-map "\e[24^" [C-S-f2]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
84 (define-key rxvt-function-map "\e[25^" [C-S-f3]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
85 (define-key rxvt-function-map "\e[26^" [C-S-f4]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
86 (define-key rxvt-function-map "\e[28^" [C-S-f5]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
87 (define-key rxvt-function-map "\e[29^" [C-S-f6]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
88 (define-key rxvt-function-map "\e[31^" [C-S-f7]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
89 (define-key rxvt-function-map "\e[32^" [C-S-f8]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
90 (define-key rxvt-function-map "\e[33^" [C-S-f9]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
91 (define-key rxvt-function-map "\e[34^" [C-S-f10]) |
42945 | 92 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
93 (define-key rxvt-function-map "\e[2^" [C-insert]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
94 (define-key rxvt-function-map "\e[3^" [C-delete]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
95 (define-key rxvt-function-map "\e[5^" [C-prior]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
96 (define-key rxvt-function-map "\e[6^" [C-next]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
97 (define-key rxvt-function-map "\e[7^" [C-home]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
98 (define-key rxvt-function-map "\e[8^" [C-end]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
99 (define-key rxvt-function-map "\eOd" [C-left]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
100 (define-key rxvt-function-map "\eOc" [C-right]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
101 (define-key rxvt-function-map "\eOa" [C-up]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
102 (define-key rxvt-function-map "\eOb" [C-down]) |
42945 | 103 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
104 (define-key rxvt-function-map "\e[2;2~" [S-insert]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
105 (define-key rxvt-function-map "\e[3$" [S-delete]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
106 (define-key rxvt-function-map "\e[5$" [S-prior]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
107 (define-key rxvt-function-map "\e[6$" [S-next]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
108 (define-key rxvt-function-map "\e[7$" [S-home]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
109 (define-key rxvt-function-map "\e[8$" [S-end]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
110 (define-key rxvt-function-map "\e[d" [S-left]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
111 (define-key rxvt-function-map "\e[c" [S-right]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
112 (define-key rxvt-function-map "\e[a" [S-up]) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
113 (define-key rxvt-function-map "\e[b" [S-down]) |
42945 | 114 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
115 (defun terminal-init-rxvt () |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
116 "Terminal initialization function for rxvt." |
42945 | 117 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
118 ;; The terminal intialization C code file might have initialized |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
119 ;; function keys F11->F42 from the termcap/terminfo information. On |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
120 ;; a PC-style keyboard these keys correspond to |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
121 ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
122 ;; code here subsitutes the corresponding defintions in |
65621
e1327485f073
(terminal-init-rxvt): Add entry for [end].
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
64701
diff
changeset
|
123 ;; function-key-map. This substitution is needed because if a key |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
124 ;; definition if found in function-key-map, there are no further |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
125 ;; lookups in other keymaps. |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
126 (substitute-key-definition [f11] [S-f1] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
127 (substitute-key-definition [f12] [S-f2] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
128 (substitute-key-definition [f13] [S-f3] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
129 (substitute-key-definition [f14] [S-f4] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
130 (substitute-key-definition [f15] [S-f5] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
131 (substitute-key-definition [f16] [S-f6] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
132 (substitute-key-definition [f17] [S-f7] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
133 (substitute-key-definition [f18] [S-f8] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
134 (substitute-key-definition [f19] [S-f9] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
135 (substitute-key-definition [f20] [S-f10] local-function-key-map) |
64596
d5254bde5ea5
* term/rxvt.el (function-key-map): Use substitute-key-definition
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
136 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
137 (substitute-key-definition [f23] [C-f1] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
138 (substitute-key-definition [f24] [C-f2] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
139 (substitute-key-definition [f25] [C-f3] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
140 (substitute-key-definition [f26] [C-f4] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
141 (substitute-key-definition [f27] [C-f5] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
142 (substitute-key-definition [f28] [C-f6] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
143 (substitute-key-definition [f29] [C-f7] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
144 (substitute-key-definition [f30] [C-f8] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
145 (substitute-key-definition [f31] [C-f9] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
146 (substitute-key-definition [f32] [C-f10] local-function-key-map) |
42945 | 147 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
148 (substitute-key-definition [f33] [C-S-f1] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
149 (substitute-key-definition [f34] [C-S-f2] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
150 (substitute-key-definition [f35] [C-S-f3] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
151 (substitute-key-definition [f36] [C-S-f4] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
152 (substitute-key-definition [f37] [C-S-f5] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
153 (substitute-key-definition [f38] [C-S-f6] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
154 (substitute-key-definition [f39] [C-S-f7] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
155 (substitute-key-definition [f40] [C-S-f8] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
156 (substitute-key-definition [f41] [C-S-f9] local-function-key-map) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
157 (substitute-key-definition [f42] [C-S-f10] local-function-key-map) |
42945 | 158 |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
159 ;; Use inheritance to let the main keymap override those defaults. |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
160 ;; This way we don't override terminfo-derived settings or settings |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
161 ;; made in the .emacs file. |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
162 (let ((m (copy-keymap rxvt-function-map))) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
163 (set-keymap-parent m (keymap-parent local-function-key-map)) |
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
164 (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:
64596
diff
changeset
|
165 |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
166 ;; Initialize colors and background mode. |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
167 (rxvt-register-default-colors) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
168 (rxvt-set-background-mode) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
169 ;; This recomputes all the default faces given the colors we've just set up. |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
170 (tty-set-up-initial-frame-faces)) |
42945 | 171 |
172 ;; Set up colors, for those versions of rxvt that support it. | |
173 (defvar rxvt-standard-colors | |
174 ;; The names of the colors in the comments taken from the rxvt.1 man | |
42962 | 175 ;; page; the corresponding RGB values--from rgb.txt. |
42945 | 176 '(("black" 0 ( 0 0 0)) ; black |
177 ("red" 1 (205 0 0)) ; red3 | |
178 ("green" 2 ( 0 205 0)) ; green3 | |
179 ("yellow" 3 (205 205 0)) ; yellow3 | |
180 ("blue" 4 ( 0 0 205)) ; blue3 | |
181 ("magenta" 5 (205 0 205)) ; magenta3 | |
182 ("cyan" 6 ( 0 205 205)) ; cyan3 | |
65639
f552d54d9430
(rxvt-standard-colors): Fix some colors.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65621
diff
changeset
|
183 ("white" 7 (229 229 229)) ; gray90 |
f552d54d9430
(rxvt-standard-colors): Fix some colors.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65621
diff
changeset
|
184 ("brightblack" 8 ( 77 77 77)) ; gray30 |
42945 | 185 ("brightred" 9 (255 0 0)) ; red |
186 ("brightgreen" 10 ( 0 255 0)) ; green | |
187 ("brightyellow" 11 (255 255 0)) ; yellow | |
188 ("brightblue" 12 ( 0 0 255)) ; blue | |
189 ("brightmagenta" 13 (255 0 255)) ; magenta | |
190 ("brightcyan" 14 ( 0 255 255)) ; cyan | |
191 ("brightwhite" 15 (255 255 255))) ; white | |
192 "Names of 16 standard rxvt colors, their numbers, and RGB values.") | |
193 | |
194 (defun rxvt-rgb-convert-to-16bit (prim) | |
195 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value." | |
196 (min 65535 (round (* (/ prim 255.0) 65535.0)))) | |
197 | |
198 (defun rxvt-register-default-colors () | |
199 "Register the default set of colors for rxvt or compatible emulator. | |
200 | |
201 This function registers the number of colors returned by `display-color-cells' | |
202 for the currently selected frame." | |
203 (let* ((ncolors (display-color-cells)) | |
204 (colors rxvt-standard-colors) | |
205 (color (car colors))) | |
206 (if (> ncolors 0) | |
207 ;; Clear the 8 default tty colors registered by startup.el | |
208 (tty-color-clear)) | |
209 ;; Only register as many colors as are supported by the display. | |
210 (while (and (> ncolors 0) colors) | |
211 (tty-color-define (car color) (cadr color) | |
212 (mapcar 'rxvt-rgb-convert-to-16bit | |
213 (car (cddr color)))) | |
214 (setq colors (cdr colors) | |
215 color (car colors) | |
216 ncolors (1- ncolors))) | |
65687
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
217 (when (> ncolors 0) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
218 (cond |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
219 ((= ncolors 240) ; 256-color rxvt |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
220 ;; 216 non-gray colors first |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
221 (let ((r 0) (g 0) (b 0)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
222 (while (> ncolors 24) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
223 ;; This and other formulae taken from 256colres.pl and |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
224 ;; 88colres.pl in the xterm distribution. |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
225 (tty-color-define (format "color-%d" (- 256 ncolors)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
226 (- 256 ncolors) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
227 (mapcar 'rxvt-rgb-convert-to-16bit |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
228 (list (round (* r 42.5)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
229 (round (* g 42.5)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
230 (round (* b 42.5))))) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
231 (setq b (1+ b)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
232 (if (> b 5) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
233 (setq g (1+ g) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
234 b 0)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
235 (if (> g 5) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
236 (setq r (1+ r) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
237 g 0)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
238 (setq ncolors (1- ncolors)))) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
239 ;; Now the 24 gray colors |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
240 (while (> ncolors 0) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
241 (setq color (rxvt-rgb-convert-to-16bit (+ 8 (* (- 24 ncolors) 10)))) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
242 (tty-color-define (format "color-%d" (- 256 ncolors)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
243 (- 256 ncolors) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
244 (list color color color)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
245 (setq ncolors (1- ncolors)))) |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
246 |
65690
dc239a66e600
* term/rxvt.el (rxvt-register-default-colors): Delete redundant
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65687
diff
changeset
|
247 ((= ncolors 72) ; rxvt-unicode |
65687
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
248 ;; 64 non-gray colors |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
249 (let ((levels '(0 139 205 255)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
250 (r 0) (g 0) (b 0)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
251 (while (> ncolors 8) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
252 (tty-color-define (format "color-%d" (- 88 ncolors)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
253 (- 88 ncolors) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
254 (mapcar 'rxvt-rgb-convert-to-16bit |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
255 (list (nth r levels) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
256 (nth g levels) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
257 (nth b levels)))) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
258 (setq b (1+ b)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
259 (if (> b 3) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
260 (setq g (1+ g) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
261 b 0)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
262 (if (> g 3) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
263 (setq r (1+ r) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
264 g 0)) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
265 (setq ncolors (1- ncolors)))) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
266 ;; Now the 8 gray colors |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
267 (while (> ncolors 0) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
268 (setq color (rxvt-rgb-convert-to-16bit |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
269 (floor |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
270 (if (= ncolors 8) |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
271 46.36363636 |
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
272 (+ (* (- 8 ncolors) 23.18181818) 69.54545454))))) |
65686
4a796295f477
* term/rxvt.el (rxvt-register-default-colors): Add support for 88
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65650
diff
changeset
|
273 (tty-color-define (format "color-%d" (- 88 ncolors)) |
4a796295f477
* term/rxvt.el (rxvt-register-default-colors): Add support for 88
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65650
diff
changeset
|
274 (- 88 ncolors) |
65687
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
275 (list color color color)) |
65686
4a796295f477
* term/rxvt.el (rxvt-register-default-colors): Add support for 88
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65650
diff
changeset
|
276 (setq ncolors (1- ncolors)))) |
65687
16baf997c85c
(rxvt-register-default-colors): Add support for 255
Dan Nicolaescu <dann@ics.uci.edu>
parents:
65686
diff
changeset
|
277 (t (error "Unsupported number of rxvt colors (%d)" (+ 16 ncolors))))) |
42945 | 278 ;; Modifying color mappings means realized faces don't use the |
279 ;; right colors, so clear them. | |
280 (clear-face-cache))) | |
281 | |
282 ;; rxvt puts the default colors into an environment variable | |
283 ;; COLORFGBG. We use this to set the background mode in a more | |
284 ;; intelligent way than the default guesswork in startup.el. | |
285 (defun rxvt-set-background-mode () | |
286 "Set background mode as appropriate for the default rxvt colors." | |
287 (let ((fgbg (getenv "COLORFGBG")) | |
288 bg rgb) | |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
289 (set-terminal-parameter nil 'background-mode 'light) |
42945 | 290 (when (and fgbg |
291 (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg)) | |
292 (setq bg (string-to-number (substring fgbg (match-beginning 1)))) | |
293 ;; The next line assumes that rxvt-standard-colors are ordered | |
294 ;; by the color index in the ascending order! | |
295 (setq rgb (car (cddr (nth bg rxvt-standard-colors)))) | |
296 ;; See the commentary in frame-set-background-mode about the | |
297 ;; computation below. | |
298 (if (< (apply '+ rgb) | |
299 ;; The following line assumes that white is the 15th | |
300 ;; color in rxvt-standard-colors. | |
301 (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6)) | |
83524
673d62ad74b5
Fix and/or simplify terminal initialization files.
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
302 (set-terminal-parameter nil 'background-mode 'dark))))) |
42945 | 303 |
65621
e1327485f073
(terminal-init-rxvt): Add entry for [end].
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
64701
diff
changeset
|
304 ;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257 |
42945 | 305 ;;; rxvt.el ends here |