Mercurial > emacs
annotate lisp/term/tvi970.el @ 81561:1ff1ce0627d8
*** empty log message ***
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Fri, 22 Jun 2007 09:05:55 +0000 |
parents | e3694f1cb928 |
children | 030ae62d5c57 b8d9a391daf3 95d0cdf160ea |
rev | line source |
---|---|
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
1 ;;; tvi970.el --- terminal support for the Televideo 970 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
2 |
74509 | 3 ;; Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005, |
75347 | 4 ;; 2006, 2007 Free Software Foundation, Inc. |
74509 | 5 |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
6 ;; Author: Jim Blandy <jimb@occs.cs.oberlin.edu>, January 1992 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
7 ;; Keywords: terminals |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
8 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
10 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
11 ;; GNU Emacs is free software; you can redistribute it and/or modify |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
13 ;; the Free Software Foundation; either version 2, or (at your option) |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
14 ;; any later version. |
530 | 15 |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
19 ;; GNU General Public License for more details. |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
20 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
14170 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64084 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
25 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
26 ;;; Commentary: |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
27 |
14170 | 28 ;; Uses the Emacs 19 terminal initialization features --- won't work with 18. |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
29 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
30 ;;; Code: |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
31 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
32 (defun terminal-init-tvi970 () |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
33 "Terminal initialization function for tvi970." |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
34 (or (lookup-key function-key-map "\e[") |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
35 (define-key function-key-map "\e[" (make-keymap))) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
36 ;; (or (lookup-key function-key-map "\eO") |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
37 ;; (define-key function-key-map "\eO" (make-keymap))) |
530 | 38 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
39 ;; Miscellaneous keys |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
40 (mapcar (function (lambda (key-binding) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
41 (define-key function-key-map |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
42 (car key-binding) (nth 1 key-binding)))) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
43 '( |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
44 ;; These are set up by termcap or terminfo |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
45 ;; ("\eOP" [kp-f1]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
46 ;; ("\eOQ" [kp-f2]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
47 ;; ("\eOR" [kp-f3]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
48 ;; ("\eOS" [kp-f4]) |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
49 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
50 ;; These might br set by terminfo |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
51 ("\e[H" [home]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
52 ("\e[Z" [backtab]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
53 ("\e[i" [print]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
54 ("\e[@" [insert]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
55 ("\e[L" [insertline]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
56 ("\e[M" [deleteline]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
57 ("\e[U" [next]) ;; actually the `page' key |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
58 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
59 ;; These won't be set up by either |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
60 ("\eOm" [kp-subtract]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
61 ("\eOl" [kp-separator]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
62 ("\eOn" [kp-decimal]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
63 ("\eOM" [kp-enter]) |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
64 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
65 ;; These won't be set up by either either |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
66 ("\e[K" [key_eol]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
67 ("\e[J" [key_eos]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
68 ("\e[2J" [key_clear]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
69 ("\e[P" [key_dc]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
70 ("\e[g" [S-tab]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
71 ("\e[2N" [clearentry]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
72 ("\e[2K" [S-clearentry]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
73 ("\e[E" [?\C-j]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
74 ("\e[g" [S-backtab]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
75 ("\e[?1i" [key_sprint]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
76 ("\e[4h" [key_sic]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
77 ("\e[4l" [S-delete]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
78 ("\e[Q" [S-insertline]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
79 ("\e[1Q" [key_sdl]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
80 ("\e[19l" [key_seol]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
81 ("\e[19h" [S-erasepage]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
82 ("\e[V" [S-page]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
83 ("\eS" [send]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
84 ("\e5" [S-send]) ;; Not an X keysym |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
85 )) |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
86 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
87 ;; The numeric keypad keys. |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
88 (let ((i 0)) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
89 (while (< i 10) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
90 (define-key function-key-map |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
91 (format "\eO%c" (+ i ?p)) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
92 (vector (intern (format "kp-%d" i)))) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
93 (setq i (1+ i)))) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
94 ;; The numbered function keys. |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
95 (let ((i 0)) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
96 (while (< i 16) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
97 (define-key function-key-map |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
98 (format "\e?%c" (+ i ?a)) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
99 (vector (intern (format "f%d" (1+ i))))) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
100 (define-key function-key-map |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
101 (format "\e?%c" (+ i ?A)) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
102 (vector (intern (format "S-f%d" (1+ i))))) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
103 (setq i (1+ i)))) |
530 | 104 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
105 (tvi970-set-keypad-mode 1)) |
530 | 106 |
107 ;;; Should keypad numbers send ordinary digits or distinct escape sequences? | |
108 (defvar tvi970-keypad-numeric nil | |
109 "The terminal should be in numeric keypad mode iff this variable is non-nil. | |
110 Do not set this variable! Call the function ``tvi970-set-keypad-mode''.") | |
111 | |
112 (defun tvi970-set-keypad-mode (&optional arg) | |
113 "Set the current mode of the TVI 970 numeric keypad. | |
114 In ``numeric keypad mode'', the number keys on the keypad act as | |
115 ordinary digits. In ``alternate keypad mode'', the keys send distinct | |
116 escape sequences, meaning that they can have their own bindings, | |
117 independent of the normal number keys. | |
118 With no argument, toggle between the two possible modes. | |
119 With a positive argument, select alternate keypad mode. | |
120 With a negative argument, select numeric keypad mode." | |
121 (interactive "P") | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38436
diff
changeset
|
122 (setq tvi970-keypad-numeric |
530 | 123 (if (null arg) |
124 (not tvi970-keypad-numeric) | |
125 (> (prefix-numeric-value arg) 0))) | |
126 (send-string-to-terminal (if tvi970-keypad-numeric "\e=" "\e>"))) | |
127 | |
52401 | 128 ;;; arch-tag: c1334cf0-1462-41c3-a963-c077d175f8f0 |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14170
diff
changeset
|
129 ;;; tvi970.el ends here |