Mercurial > emacs
annotate lisp/term/rxvt.el @ 83353:532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied:
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0
tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1
Add CVS metadata files.
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2
Update from CVS.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sun, 04 Sep 2005 03:48:17 +0000 |
parents | 7372c2f9daac 34bd8e434dd7 |
children | 3d2bc61f2da0 |
rev | line source |
---|---|
42945 | 1 ;;; rxvt.el --- define function key sequences and standard colors for rxvt |
2 | |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64651
diff
changeset
|
3 ;; Copyright (C) 2002, 2003, 2004, 2005 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 | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
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 | |
83277
886073e54ccb
Fix some superflous deviations from CVS, plus apply some cosmetics.
Karoly Lorentey <lorentey@elte.hu>
parents:
83118
diff
changeset
|
29 (require 'server) |
83118
7652900ea029
Fixed environment variable handling during terminal initialization.
Karoly Lorentey <lorentey@elte.hu>
parents:
52401
diff
changeset
|
30 |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
31 (defvar rxvt-function-map nil |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
32 "Function key overrides for rxvt.") |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
33 |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
34 ;; Protect against reloads. |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
35 (unless rxvt-function-map |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
36 (setq rxvt-function-map (make-sparse-keymap)) |
83297
8e357d90cc9f
Fix exponential slowdowns on repeated tty frame creation.
Karoly Lorentey <lorentey@elte.hu>
parents:
83277
diff
changeset
|
37 |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
38 ;; Set up function-key-map entries that termcap and terminfo don't know. |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
39 (define-key rxvt-function-map "\e[A" [up]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
40 (define-key rxvt-function-map "\e[B" [down]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
41 (define-key rxvt-function-map "\e[C" [right]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
42 (define-key rxvt-function-map "\e[D" [left]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
43 (define-key rxvt-function-map "\e[7~" [home]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
44 (define-key rxvt-function-map "\e[2~" [insert]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
45 (define-key rxvt-function-map "\e[3~" [delete]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
46 (define-key rxvt-function-map "\e[4~" [select]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
47 (define-key rxvt-function-map "\e[5~" [prior]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
48 (define-key rxvt-function-map "\e[6~" [next]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
49 (define-key rxvt-function-map "\e[11~" [f1]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
50 (define-key rxvt-function-map "\e[12~" [f2]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
51 (define-key rxvt-function-map "\e[13~" [f3]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
52 (define-key rxvt-function-map "\e[14~" [f4]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
53 (define-key rxvt-function-map "\e[15~" [f5]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
54 (define-key rxvt-function-map "\e[17~" [f6]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
55 (define-key rxvt-function-map "\e[18~" [f7]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
56 (define-key rxvt-function-map "\e[19~" [f8]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
57 (define-key rxvt-function-map "\e[20~" [f9]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
58 (define-key rxvt-function-map "\e[21~" [f10]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
59 ;; The strings emitted by f11 and f12 are the same as the strings |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
60 ;; emitted by S-f1 and S-f2, so don't define f11 and f12. |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
61 ;; (define-key rxvt-function-map "\e[23~" [f11]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
62 ;; (define-key rxvt-function-map "\e[24~" [f12]) |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
63 (define-key rxvt-function-map "\e[29~" [print]) |
42945 | 64 |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
65 (define-key rxvt-function-map "\e[11^" [C-f1]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
66 (define-key rxvt-function-map "\e[12^" [C-f2]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
67 (define-key rxvt-function-map "\e[13^" [C-f3]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
68 (define-key rxvt-function-map "\e[14^" [C-f4]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
69 (define-key rxvt-function-map "\e[15^" [C-f5]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
70 (define-key rxvt-function-map "\e[17^" [C-f6]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
71 (define-key rxvt-function-map "\e[18^" [C-f7]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
72 (define-key rxvt-function-map "\e[19^" [C-f8]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
73 (define-key rxvt-function-map "\e[20^" [C-f9]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
74 (define-key rxvt-function-map "\e[21^" [C-f10]) |
42945 | 75 |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
76 (define-key rxvt-function-map "\e[23~" [S-f1]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
77 (define-key rxvt-function-map "\e[24~" [S-f2]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
78 (define-key rxvt-function-map "\e[25~" [S-f3]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
79 (define-key rxvt-function-map "\e[26~" [S-f4]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
80 (define-key rxvt-function-map "\e[28~" [S-f5]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
81 (define-key rxvt-function-map "\e[29~" [S-f6]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
82 (define-key rxvt-function-map "\e[31~" [S-f7]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
83 (define-key rxvt-function-map "\e[32~" [S-f8]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
84 (define-key rxvt-function-map "\e[33~" [S-f9]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
85 (define-key rxvt-function-map "\e[34~" [S-f10]) |
42945 | 86 |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
87 (define-key rxvt-function-map "\e[23^" [C-S-f1]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
88 (define-key rxvt-function-map "\e[24^" [C-S-f2]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
89 (define-key rxvt-function-map "\e[25^" [C-S-f3]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
90 (define-key rxvt-function-map "\e[26^" [C-S-f4]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
91 (define-key rxvt-function-map "\e[28^" [C-S-f5]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
92 (define-key rxvt-function-map "\e[29^" [C-S-f6]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
93 (define-key rxvt-function-map "\e[31^" [C-S-f7]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
94 (define-key rxvt-function-map "\e[32^" [C-S-f8]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
95 (define-key rxvt-function-map "\e[33^" [C-S-f9]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
96 (define-key rxvt-function-map "\e[34^" [C-S-f10]) |
42945 | 97 |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
98 (define-key rxvt-function-map "\e[2^" [C-insert]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
99 (define-key rxvt-function-map "\e[3^" [C-delete]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
100 (define-key rxvt-function-map "\e[5^" [C-prior]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
101 (define-key rxvt-function-map "\e[6^" [C-next]) |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
102 (define-key rxvt-function-map "\e[7^" [C-home]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
103 (define-key rxvt-function-map "\e[8^" [C-end]) |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
104 (define-key rxvt-function-map "\eOd" [C-left]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
105 (define-key rxvt-function-map "\eOc" [C-right]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
106 (define-key rxvt-function-map "\eOa" [C-up]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
107 (define-key rxvt-function-map "\eOb" [C-down]) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42962
diff
changeset
|
108 |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
109 (define-key rxvt-function-map "\e[2;2~" [S-insert]) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
110 (define-key rxvt-function-map "\e[3$" [S-delete]) |
83305
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
111 (define-key rxvt-function-map "\e[5$" [S-prior]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
112 (define-key rxvt-function-map "\e[6$" [S-next]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
113 (define-key rxvt-function-map "\e[8$" [S-end]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
114 (define-key rxvt-function-map "\e[7$" [S-home]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
115 (define-key rxvt-function-map "\e[d" [S-left]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
116 (define-key rxvt-function-map "\e[c" [S-right]) |
80cb3fe96145
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
Karoly Lorentey <lorentey@elte.hu>
parents:
83297
diff
changeset
|
117 (define-key rxvt-function-map "\e[a" [S-up]) |
83316
102194c6d773
Update Lisp code for a terminal-local `function-key-map'.
Karoly Lorentey <lorentey@elte.hu>
parents:
83305
diff
changeset
|
118 (define-key rxvt-function-map "\e[b" [S-down])) |
42945 | 119 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
120 (defun terminal-init-rxvt () |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
121 "Terminal initialization function for rxvt." |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
122 ;; 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
|
123 ;; 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
|
124 ;; 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
|
125 ;; 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
|
126 ;; code here subsitutes the corresponding defintions in |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
127 ;; function-key-map. This substitution is needed because if a key |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
128 ;; 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
|
129 ;; lookups in other keymaps. |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64651
diff
changeset
|
130 (substitute-key-definition [f11] [S-f1] function-key-map) |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
131 (substitute-key-definition [f12] [S-f2] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
132 (substitute-key-definition [f13] [S-f3] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
133 (substitute-key-definition [f14] [S-f4] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
134 (substitute-key-definition [f15] [S-f5] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
135 (substitute-key-definition [f16] [S-f6] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
136 (substitute-key-definition [f17] [S-f7] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
137 (substitute-key-definition [f18] [S-f8] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
138 (substitute-key-definition [f19] [S-f9] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
139 (substitute-key-definition [f20] [S-f10] 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
|
140 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64651
diff
changeset
|
141 (substitute-key-definition [f23] [C-f1] function-key-map) |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
142 (substitute-key-definition [f24] [C-f2] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
143 (substitute-key-definition [f25] [C-f3] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
144 (substitute-key-definition [f26] [C-f4] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
145 (substitute-key-definition [f27] [C-f5] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
146 (substitute-key-definition [f28] [C-f6] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
147 (substitute-key-definition [f29] [C-f7] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
148 (substitute-key-definition [f30] [C-f8] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
149 (substitute-key-definition [f31] [C-f9] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
150 (substitute-key-definition [f32] [C-f10] 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
|
151 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64651
diff
changeset
|
152 (substitute-key-definition [f33] [C-S-f1] function-key-map) |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
153 (substitute-key-definition [f34] [C-S-f2] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
154 (substitute-key-definition [f35] [C-S-f3] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
155 (substitute-key-definition [f36] [C-S-f4] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
156 (substitute-key-definition [f37] [C-S-f5] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
157 (substitute-key-definition [f38] [C-S-f6] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
158 (substitute-key-definition [f39] [C-S-f7] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
159 (substitute-key-definition [f40] [C-S-f8] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
160 (substitute-key-definition [f41] [C-S-f9] function-key-map) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
161 (substitute-key-definition [f42] [C-S-f10] 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
|
162 |
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
163 ;; Use inheritance to let the main keymap override those defaults. |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
164 ;; This way we don't override terminfo-derived settings or settings |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
165 ;; made in the .emacs file. |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
166 (let ((m (copy-keymap rxvt-function-map))) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
167 (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil))) |
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
168 (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m)) |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
169 |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
170 ;; 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
|
171 (rxvt-register-default-colors) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
172 (rxvt-set-background-mode) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64596
diff
changeset
|
173 ;; 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
|
174 (tty-set-up-initial-frame-faces)) |
42945 | 175 |
176 ;; Set up colors, for those versions of rxvt that support it. | |
177 (defvar rxvt-standard-colors | |
178 ;; The names of the colors in the comments taken from the rxvt.1 man | |
42962 | 179 ;; page; the corresponding RGB values--from rgb.txt. |
42945 | 180 '(("black" 0 ( 0 0 0)) ; black |
181 ("red" 1 (205 0 0)) ; red3 | |
182 ("green" 2 ( 0 205 0)) ; green3 | |
183 ("yellow" 3 (205 205 0)) ; yellow3 | |
184 ("blue" 4 ( 0 0 205)) ; blue3 | |
185 ("magenta" 5 (205 0 205)) ; magenta3 | |
186 ("cyan" 6 ( 0 205 205)) ; cyan3 | |
187 ("white" 7 (250 235 215)) ; AntiqueWhite | |
188 ("brightblack" 8 ( 64 64 64)) ; gray25 | |
189 ("brightred" 9 (255 0 0)) ; red | |
190 ("brightgreen" 10 ( 0 255 0)) ; green | |
191 ("brightyellow" 11 (255 255 0)) ; yellow | |
192 ("brightblue" 12 ( 0 0 255)) ; blue | |
193 ("brightmagenta" 13 (255 0 255)) ; magenta | |
194 ("brightcyan" 14 ( 0 255 255)) ; cyan | |
195 ("brightwhite" 15 (255 255 255))) ; white | |
196 "Names of 16 standard rxvt colors, their numbers, and RGB values.") | |
197 | |
198 (defun rxvt-rgb-convert-to-16bit (prim) | |
199 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value." | |
200 (min 65535 (round (* (/ prim 255.0) 65535.0)))) | |
201 | |
202 (defun rxvt-register-default-colors () | |
203 "Register the default set of colors for rxvt or compatible emulator. | |
204 | |
205 This function registers the number of colors returned by `display-color-cells' | |
206 for the currently selected frame." | |
207 (let* ((ncolors (display-color-cells)) | |
208 (colors rxvt-standard-colors) | |
209 (color (car colors))) | |
210 (if (> ncolors 0) | |
211 ;; Clear the 8 default tty colors registered by startup.el | |
212 (tty-color-clear)) | |
213 ;; Only register as many colors as are supported by the display. | |
214 (while (and (> ncolors 0) colors) | |
215 (tty-color-define (car color) (cadr color) | |
216 (mapcar 'rxvt-rgb-convert-to-16bit | |
217 (car (cddr color)))) | |
218 (setq colors (cdr colors) | |
219 color (car colors) | |
220 ncolors (1- ncolors))) | |
221 ;; Modifying color mappings means realized faces don't use the | |
222 ;; right colors, so clear them. | |
223 (clear-face-cache))) | |
224 | |
225 ;; rxvt puts the default colors into an environment variable | |
226 ;; COLORFGBG. We use this to set the background mode in a more | |
227 ;; intelligent way than the default guesswork in startup.el. | |
228 (defun rxvt-set-background-mode () | |
229 "Set background mode as appropriate for the default rxvt colors." | |
83118
7652900ea029
Fixed environment variable handling during terminal initialization.
Karoly Lorentey <lorentey@elte.hu>
parents:
52401
diff
changeset
|
230 (let ((fgbg (server-getenv "COLORFGBG")) |
42945 | 231 bg rgb) |
63861 | 232 (setq default-frame-background-mode 'light) |
42945 | 233 (when (and fgbg |
234 (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg)) | |
235 (setq bg (string-to-number (substring fgbg (match-beginning 1)))) | |
236 ;; The next line assumes that rxvt-standard-colors are ordered | |
237 ;; by the color index in the ascending order! | |
238 (setq rgb (car (cddr (nth bg rxvt-standard-colors)))) | |
239 ;; See the commentary in frame-set-background-mode about the | |
240 ;; computation below. | |
241 (if (< (apply '+ rgb) | |
242 ;; The following line assumes that white is the 15th | |
243 ;; color in rxvt-standard-colors. | |
244 (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6)) | |
63861 | 245 (setq default-frame-background-mode 'dark))) |
42945 | 246 (frame-set-background-mode (selected-frame)))) |
247 | |
52401 | 248 ;;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257 |
42945 | 249 ;;; rxvt.el ends here |