aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond1993-03-11 08:52:30 +0000
committerEric S. Raymond1993-03-11 08:52:30 +0000
commit7f94bc9fb34d15d54a2c8cb570683000f6a7c358 (patch)
tree8c14f490bfcd41f3d6a56ab4a064f3b12b6e7e93
parenta97beda4865c2d3f4c2341daa9d35e6e56de9ac9 (diff)
downloademacs-7f94bc9fb34d15d54a2c8cb570683000f6a7c358.tar.gz
emacs-7f94bc9fb34d15d54a2c8cb570683000f6a7c358.zip
Added headers, changed some keycap names.
-rw-r--r--lisp/term/wyse50.el227
1 files changed, 119 insertions, 108 deletions
diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el
index 81a7b321142..c3a990d9026 100644
--- a/lisp/term/wyse50.el
+++ b/lisp/term/wyse50.el
@@ -1,10 +1,42 @@
1;;;; Terminal mode for Wyse 50 1;;; wyse50.el --- terminal support code for Wyse 50
2;;;; Should work well for Televideo TVI 925 although it's overkill 2
3;;;; Author Daniel Pfieffer (pfieffer@cix.cict.fr) January 1991 3;; Author: Daniel Pfieffer <pfieffer@cix.cict.fr> January 1991
4;;;; Rewritten for Emacs 19 by Jim Blandy (jimb@occs.cs.oberlin.edu) 4;; Jim Blandy <jimb@occs.cs.oberlin.edu>
5;;;; January 1992 5;; Keywords: terminals
6
7;; Copyright (C) 1989 Free Software Foundation, Inc.
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is distributed in the hope that it will be useful,
12;; but WITHOUT ANY WARRANTY. No author or distributor
13;; accepts responsibility to anyone for the consequences of using it
14;; or for whether it serves any particular purpose or works at all,
15;; unless he says so in writing. Refer to the GNU Emacs General Public
16;; License for full details.
17
18;; Everyone is granted permission to copy, modify and redistribute
19;; GNU Emacs, but only under the conditions described in the
20;; GNU Emacs General Public License. A copy of this license is
21;; supposed to have been given to you along with GNU Emacs so you
22;; can know your rights and responsibilities. It should be in a
23;; file named COPYING. Among other things, the copyright notice
24;; and this notice must be preserved on all copies.
25
26;;; Commentary:
27
28;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
29;; Rewritten for Emacs 19 by jimb, January 1992
30;; Cleaned up for new terminal package cinventions by esr, March 1993
31;; Should work well for Televideo TVI 925 although it's overkill.
32;;
33;; The Wyse50 is ergonomically wonderful, but its escape-sequence design sucks
34;; rocks. The left-arrow key emits a backspace (!) and the down-arrow a line
35;; feed (!!). Thus, you have to unbind some commonly-used Emacs keys to
36;; enable the arrows.
37
38;;; Code:
6 39
7
8;;; Functions especially for this terminal. 40;;; Functions especially for this terminal.
9 41
10(defun wyse-50-insert-line () 42(defun wyse-50-insert-line ()
@@ -61,108 +93,70 @@ With an argument N, move to the Nth line from the bottom of the window."
61(mapcar (function (lambda (key-definition) 93(mapcar (function (lambda (key-definition)
62 (define-key function-key-map 94 (define-key function-key-map
63 (car key-definition) (nth 1 key-definition)))) 95 (car key-definition) (nth 1 key-definition))))
64 '(("\eI" [S-tab]) 96 '(
65 ("\eJ" [S-prior]) 97 ;; These might be set up by termcap and terminfo
66 ("\eK" [next]) 98 ("\C-k" [up])
67 ("\eY" [clear]) 99 ("\C-j" [down])
68 ("\eT" [clear-eol]) 100 ("\C-l" [right])
69 ("\^^" [home]) 101 ("\C-h" [left])
70 ("\e\^^" [home-down]) 102 ("\^a@\^m" [f1])
71 ("\eQ" [insert]) 103 ("\^aA\^m" [f2])
72 ("\eE" [insertline]) 104 ("\^aB\^m" [f3])
73 ("\eW" [?\C-?]) 105 ("\^aC\^m" [f4])
74 ("\eR" [deleteline]) 106 ("\^aD\^m" [f5])
75 ("\eP" [print]) 107 ("\^aE\^m" [f6])
76 ("\C-k" [up]) 108 ("\^aF\^m" [f7])
77 ("\C-j" [down]) 109 ("\^aG\^m" [f8])
78 ("\C-l" [right]) 110 ("\^aH\^m" [f9])
79 ("\C-h" [left])
80 ("\C-a\C-k\C-m" [funct-up])
81 ("\C-a\C-j\C-m" [funct-down])
82 ("\C-a\C-l\C-m" [funct-right])
83 ("\C-a\C-h\C-m" [funct-left])
84 ("\er" [replace])
85 ("\^a\^m\^m" [funct-return])
86 ("\^a\^i\^m" [funct-tab])
87 ("\^a@\^m" [f1])
88 ("\^a`\^m" [S-f1])
89 ("\^aA\^m" [f2])
90 ("\^aa\^m" [S-f2])
91 ("\^aB\^m" [f3])
92 ("\^ab\^m" [S-f3])
93 ("\^aC\^m" [f4])
94 ("\^ac\^m" [S-f4])
95 ("\^aD\^m" [f5])
96 ("\^ad\^m" [S-f5])
97 ("\^aE\^m" [f6])
98 ("\^ae\^m" [S-f6])
99 ("\^aF\^m" [f7])
100 ("\^af\^m" [S-f7])
101 ("\^aG\^m" [f8])
102 ("\^ag\^m" [S-f8])
103 ("\^aH\^m" [f9])
104 ("\^ah\^m" [S-f9])
105 ("\^aI\^m" [f10])
106 ("\^ai\^m" [S-f10])
107 ("\^aJ\^m" [f11])
108 ("\^aj\^m" [S-f11])
109 ("\^aK\^m" [f12])
110 ("\^ak\^m" [S-f12])
111 ("\^aL\^m" [f13])
112 ("\^al\^m" [S-f13])
113 ("\^aM\^m" [f14])
114 ("\^am\^m" [S-f14])
115 ("\^aN\^m" [f15])
116 ("\^an\^m" [S-f15])
117 ("\^aO\^m" [f16])
118 ("\^ao\^m" [S-f16])))
119 111
120 112 ;; These might be set up by terminfo
121;;; Define some of the function keys. 113 ("\eK" [next])
122(mapcar (function (lambda (key-definition) 114 ("\eT" [clearline])
123 (global-set-key (car key-definition) 115 ("\^^" [home])
124 (nth 1 key-definition)))) 116 ("\e\^^" [end])
125 '(([insertline] wyse-50-insert-line) 117 ("\eQ" [insert])
126 ([clear] recenter) 118 ("\eE" [insertline])
127 ([clear-eol] kill-line) 119 ("\eR" [deleteline])
128 ([home] execute-extended-command) 120 ("\eP" [print])
129 ([home-down] shell-command) 121 ("\er" [replace])
130 ([insert] wyse-50-insert-char) 122 ("\^aI\^m" [f10])
131 ([deleteline] wyse-50-delete-line) 123 ("\^aJ\^m" [f11])
132 ([replace] overwrite-mode) 124 ("\^aK\^m" [f12])
133 ([print] wyse-50-print-buffer) 125 ("\^aL\^m" [f13])
134 ([funct-up] wyse-50-top-of-window) 126 ("\^aM\^m" [f14])
135 ([funct-down] wyse-50-bottom-of-window) 127 ("\^aN\^m" [f15])
136 ([funct-left] beginning-of-line) 128 ("\^aO\^m" [f16])
137 ([funct-right] end-of-line) 129 ("\^a`\^m" [f17])
138 ([f5] shell) 130 ("\^aa\^m" [f18])
139 ([f6] dired) 131 ("\^ab\^m" [f19])
140 ([f7] rnews) 132 ("\^ac\^m" [f20])
141 ([f8] rmail) 133 ("\^ad\^m" [f21])
142 ([f9] delete-othe-windows) 134 ("\^ae\^m" [f22])
143 ([f10] other-window) 135 ("\^af\^m" [f23])
144 ([f11] split-window-vertically) 136 ("\^ag\^m" [f24])
145 ([f13] help-for-help) 137 ("\^ah\^m" [f25])
146 ([f14] wyse-50-toggle-screen-width) 138 ("\^ai\^m" [f26])
147 ([f15] global-set-key) 139 ("\^aj\^m" [f27])
148 ("\M-?" help-for-help))) 140 ("\^ak\^m" [f28])
141 ("\^al\^m" [f29])
142 ("\^am\^m" [f30])
143 ("\^an\^m" [f31])
144 ("\^ao\^m" [f32])
149 145
150 146 ;; Terminfo may know about these, but X won't
151;;; Miscellaneous hacks 147 ("\eI" [key-stab]) ;; Not an X keysym
148 ("\eJ" [key-snext]) ;; Not an X keysym
149 ("\eY" [key-clear]) ;; Not an X keysym
152 150
153;;; This is an ugly hack for a nasty problem: 151 ;; These are totally strange :-)
154;;; Wyse 50 takes one character cell to store video attributes (which seems to 152 ("\eW" [?\C-?]) ;; Not an X keysym
155;;; explain width 79 rather than 80, column 1 is not used!!!). 153 ("\^a\^k\^m" [funct-up]) ;; Not an X keysym
156;;; On killing (C-x C-c) the end inverse code (on column 1 of line 24) 154 ("\^a\^j\^m" [funct-down]) ;; Not an X keysym
157;;; of the mode line is overwritten AFTER all the y-or-n questions. 155 ("\^a\^l\^m" [funct-right]) ;; Not an X keysym
158;;; This causes the attribute to remain in effect until the mode line has 156 ("\^a\^h\^m" [funct-left]) ;; Not an X keysym
159;;; scrolled of the screen. Suspending (C-z) does not cause this problem. 157 ("\^a\^m\^m" [funct-return]) ;; Not an X keysym
160;;; On such terminals, Emacs should sacrifice the first and last character of 158 ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym
161;;; each mode line, rather than a whole screen column! 159))
162(setq kill-emacs-hook
163 (function (lambda () (interactive)
164 (send-string-to-terminal
165 (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))
166 160
167(defun enable-arrow-keys () 161(defun enable-arrow-keys ()
168 "To be called by term-setup-hook. Overrides 6 Emacs standard keys 162 "To be called by term-setup-hook. Overrides 6 Emacs standard keys
@@ -173,8 +167,7 @@ LFD Funct Return, some modes override down-arrow via LFD
173C-k CLR Line 167C-k CLR Line
174C-l Scrn CLR 168C-l Scrn CLR
175M-r M-x move-to-window-line, Funct up-arrow or down-arrow are similar 169M-r M-x move-to-window-line, Funct up-arrow or down-arrow are similar
176All special keys except Send, Shift Ins, Shift Home and shifted functions keys 170"
177are assigned some hopefully useful meaning."
178 (interactive) 171 (interactive)
179 (mapcar (function (lambda (key-definition) 172 (mapcar (function (lambda (key-definition)
180 (global-set-key (car key-definition) 173 (global-set-key (car key-definition)
@@ -183,10 +176,28 @@ are assigned some hopefully useful meaning."
183 ;; allow the rest of the function keys which start with C-a 176 ;; allow the rest of the function keys which start with C-a
184 ;; to be recognized. 177 ;; to be recognized.
185 '(("\C-a" nil) 178 '(("\C-a" nil)
186 ("\C-a\C-a" beginning-of-line)
187 ("\C-k" nil) 179 ("\C-k" nil)
188 ("\C-j" nil) 180 ("\C-j" nil)
189 ("\C-l" nil) 181 ("\C-l" nil)
190 ("\C-h" nil) 182 ("\C-h" nil)
191 ("\er" nil))) 183 ("\er" nil)))
192 (fset 'enable-arrow-keys nil)) 184 (fset 'enable-arrow-keys nil))
185
186
187;;; Miscellaneous hacks
188
189;;; This is an ugly hack for a nasty problem:
190;;; Wyse 50 takes one character cell to store video attributes (which seems to
191;;; explain width 79 rather than 80, column 1 is not used!!!).
192;;; On killing (C-x C-c) the end inverse code (on column 1 of line 24)
193;;; of the mode line is overwritten AFTER all the y-or-n questions.
194;;; This causes the attribute to remain in effect until the mode line has
195;;; scrolled of the screen. Suspending (C-z) does not cause this problem.
196;;; On such terminals, Emacs should sacrifice the first and last character of
197;;; each mode line, rather than a whole screen column!
198(setq kill-emacs-hook
199 (function (lambda () (interactive)
200 (send-string-to-terminal
201 (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))
202
203;;; wyse50.el ends here