Mercurial > emacs
annotate lisp/term/tvi970.el @ 68140:4baa8cfc2485
(init-file-user): defcustom -> defvar.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Thu, 12 Jan 2006 02:27:00 +0000 |
parents | 34bd8e434dd7 |
children | 067115a6e738 532e0a9335a9 edf295560b5a |
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 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
3 ;; 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
|
4 ;; Keywords: terminals |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
5 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64651
diff
changeset
|
6 ;; Copyright (C) 1992, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
7 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
8 ;; 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
|
9 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
10 ;; 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
|
11 ;; 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
|
12 ;; 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
|
13 ;; any later version. |
530 | 14 |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
15 ;; 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
|
16 ;; 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
|
17 ;; 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
|
18 ;; 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
|
19 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
14170 | 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. | |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
24 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
25 ;;; Commentary: |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
26 |
14170 | 27 ;; 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
|
28 |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
29 ;;; Code: |
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
30 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
31 (defun terminal-init-tvi970 () |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
32 "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
|
33 (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
|
34 (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
|
35 ;; (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
|
36 ;; (define-key function-key-map "\eO" (make-keymap))) |
530 | 37 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
38 ;; Miscellaneous keys |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
39 (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
|
40 (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
|
41 (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
|
42 '( |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
43 ;; 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
|
44 ;; ("\eOP" [kp-f1]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
45 ;; ("\eOQ" [kp-f2]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
46 ;; ("\eOR" [kp-f3]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
47 ;; ("\eOS" [kp-f4]) |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
48 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
49 ;; 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
|
50 ("\e[H" [home]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
51 ("\e[Z" [backtab]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
52 ("\e[i" [print]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
53 ("\e[@" [insert]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
54 ("\e[L" [insertline]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
55 ("\e[M" [deleteline]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
56 ("\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
|
57 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
58 ;; 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
|
59 ("\eOm" [kp-subtract]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
60 ("\eOl" [kp-separator]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
61 ("\eOn" [kp-decimal]) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
62 ("\eOM" [kp-enter]) |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
63 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
64 ;; 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
|
65 ("\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
|
66 ("\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
|
67 ("\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
|
68 ("\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
|
69 ("\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
|
70 ("\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
|
71 ("\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
|
72 ("\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
|
73 ("\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
|
74 ("\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
|
75 ("\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
|
76 ("\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
|
77 ("\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
|
78 ("\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
|
79 ("\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
|
80 ("\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
|
81 ("\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
|
82 ("\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
|
83 ("\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
|
84 )) |
2141
9bc89a98c002
Added headers, changes some keycap names.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
530
diff
changeset
|
85 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
86 ;; The numeric keypad keys. |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
87 (let ((i 0)) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
88 (while (< i 10) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
89 (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
|
90 (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
|
91 (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
|
92 (setq i (1+ i)))) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
93 ;; The numbered function keys. |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
94 (let ((i 0)) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
95 (while (< i 16) |
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
96 (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
|
97 (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
|
98 (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
|
99 (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
|
100 (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
|
101 (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
|
102 (setq i (1+ i)))) |
530 | 103 |
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
parents:
64084
diff
changeset
|
104 (tvi970-set-keypad-mode 1)) |
530 | 105 |
106 ;;; Should keypad numbers send ordinary digits or distinct escape sequences? | |
107 (defvar tvi970-keypad-numeric nil | |
108 "The terminal should be in numeric keypad mode iff this variable is non-nil. | |
109 Do not set this variable! Call the function ``tvi970-set-keypad-mode''.") | |
110 | |
111 (defun tvi970-set-keypad-mode (&optional arg) | |
112 "Set the current mode of the TVI 970 numeric keypad. | |
113 In ``numeric keypad mode'', the number keys on the keypad act as | |
114 ordinary digits. In ``alternate keypad mode'', the keys send distinct | |
115 escape sequences, meaning that they can have their own bindings, | |
116 independent of the normal number keys. | |
117 With no argument, toggle between the two possible modes. | |
118 With a positive argument, select alternate keypad mode. | |
119 With a negative argument, select numeric keypad mode." | |
120 (interactive "P") | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38436
diff
changeset
|
121 (setq tvi970-keypad-numeric |
530 | 122 (if (null arg) |
123 (not tvi970-keypad-numeric) | |
124 (> (prefix-numeric-value arg) 0))) | |
125 (send-string-to-terminal (if tvi970-keypad-numeric "\e=" "\e>"))) | |
126 | |
52401 | 127 ;;; 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
|
128 ;;; tvi970.el ends here |