Mercurial > hg > xemacs-beta
annotate lisp/term/tvi970.el @ 5940:c608d4b0b75e cygwin64 tip
rescue lost branch from 64bit.backup
author | Henry Thompson <ht@markup.co.uk> |
---|---|
date | Thu, 16 Dec 2021 18:48:58 +0000 |
parents | 308d34e9f07d |
children |
rev | line source |
---|---|
428 | 1 ;;; tvi970.el --- terminal support for the Televideo 970 |
2 | |
3 ;; Author: Jim Blandy <jimb@occs.cs.oberlin.edu>, January 1992 | |
4 ;; Keywords: terminals | |
5 | |
6 ;; Copyright (C) 1992 Free Software Foundation, Inc. | |
7 | |
8 ;; This file is part of XEmacs. | |
9 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
10 ;; XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
11 ;; under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
12 ;; Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
13 ;; option) any later version. |
428 | 14 |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
15 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
17 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
18 ;; for more details. |
428 | 19 |
20 ;; You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4783
diff
changeset
|
21 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
428 | 22 |
23 ;;; Commentary: | |
24 | |
25 ;;; Uses the Emacs 19 terminal initialization features --- won't work with 18. | |
26 | |
27 ;;; Code: | |
28 | |
29 (or (lookup-key function-key-map "\e[") | |
30 (define-key function-key-map "\e[" (make-keymap))) | |
31 ;; (or (lookup-key function-key-map "\eO") | |
32 ;; (define-key function-key-map "\eO" (make-keymap))) | |
33 | |
34 ;; Miscellaneous keys | |
4783
e29fcfd8df5f
Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2116
diff
changeset
|
35 (mapc (function (lambda (key-binding) |
428 | 36 (define-key function-key-map |
37 (car key-binding) (nth 1 key-binding)))) | |
38 '( | |
39 ;; These are set up by termcap or terminfo | |
40 ;; ("\eOP" [kp-f1]) | |
41 ;; ("\eOQ" [kp-f2]) | |
42 ;; ("\eOR" [kp-f3]) | |
43 ;; ("\eOS" [kp-f4]) | |
44 | |
2116 | 45 ;; These might be set by terminfo |
428 | 46 ("\e[H" [home]) |
47 ("\e[Z" [backtab]) | |
48 ("\e[i" [print]) | |
49 ("\e[@" [insert]) | |
50 ("\e[L" [insertline]) | |
51 ("\e[M" [deleteline]) | |
52 ("\e[U" [next]) ;; actually the `page' key | |
53 | |
54 ;; These won't be set up by either | |
55 ("\eOm" [kp-subtract]) | |
56 ("\eOl" [kp-separator]) | |
57 ("\eOn" [kp-decimal]) | |
58 ("\eOM" [kp-enter]) | |
59 | |
2116 | 60 ;; These won't be set up by either |
428 | 61 ("\e[K" [key-eol]) ;; Not an X keysym |
62 ("\e[J" [key-eos]) ;; Not an X keysym | |
63 ("\e[2J" [key-clear]) ;; Not an X keysym | |
64 ("\e[P" [key-dc]) ;; Not an X keysym | |
65 ("\e[g" [(shift tab)]) ;; Not an X keysym | |
66 ("\e[2N" [clearentry]) ;; Not an X keysym | |
67 ("\e[2K" [(shift clearentry)]) ;; Not an X keysym | |
68 ("\e[E" [?\C-j]) ;; Not an X keysym | |
69 ("\e[g" [(shift backtab)]) ;; Not an X keysym | |
70 ("\e[?1i" [key-sprint]) ;; Not an X keysym | |
71 ("\e[4h" [key-sic]) ;; Not an X keysym | |
72 ("\e[4l" [(shift delete)]) ;; Not an X keysym | |
73 ("\e[Q" [(shift insertline)]) ;; Not an X keysym | |
74 ("\e[1Q" [key-sdl]) ;; Not an X keysym | |
75 ("\e[19l" [key-seol]) ;; Not an X keysym | |
76 ("\e[19h" [(shift erasepage)]) ;; Not an X keysym | |
77 ("\e[V" [(shift page)]) ;; Not an X keysym | |
78 ("\eS" [send]) ;; Not an X keysym | |
79 ("\e5" [(shift send)]) ;; Not an X keysym | |
80 )) | |
81 | |
82 ;; The numeric keypad keys. | |
83 (let ((i 0)) | |
84 (while (< i 10) | |
85 (define-key function-key-map | |
86 (format "\eO%c" (+ i ?p)) | |
87 (vector (intern (format "kp-%d" i)))) | |
88 (setq i (1+ i)))) | |
89 ;; The numbered function keys. | |
90 (let ((i 0)) | |
91 (while (< i 16) | |
92 (define-key function-key-map | |
93 (format "\e?%c" (+ i ?a)) | |
94 (vector (intern (format "f%d" (1+ i))))) | |
95 (define-key function-key-map | |
96 (format "\e?%c" (+ i ?A)) | |
97 (vector (list 'shift (intern (format "f%d" (1+ i)))))) | |
98 (setq i (1+ i)))) | |
99 | |
100 | |
101 ;;; Should keypad numbers send ordinary digits or distinct escape sequences? | |
102 (defvar tvi970-keypad-numeric nil | |
103 "The terminal should be in numeric keypad mode iff this variable is non-nil. | |
104 Do not set this variable! Call the function ``tvi970-set-keypad-mode''.") | |
105 | |
106 (defun tvi970-set-keypad-mode (&optional arg) | |
107 "Set the current mode of the TVI 970 numeric keypad. | |
108 In ``numeric keypad mode'', the number keys on the keypad act as | |
109 ordinary digits. In ``alternate keypad mode'', the keys send distinct | |
110 escape sequences, meaning that they can have their own bindings, | |
111 independent of the normal number keys. | |
112 With no argument, toggle between the two possible modes. | |
113 With a positive argument, select alternate keypad mode. | |
114 With a negative argument, select numeric keypad mode." | |
115 (interactive "P") | |
116 (setq tvi970-keypad-numeric | |
117 (if (null arg) | |
118 (not tvi970-keypad-numeric) | |
119 (> (prefix-numeric-value arg) 0))) | |
120 (send-string-to-terminal (if tvi970-keypad-numeric "\e=" "\e>"))) | |
121 | |
122 (tvi970-set-keypad-mode 1) | |
123 | |
124 ;;; tv970 ends here |