1 ;;; wyse50.el --- terminal support code for Wyse 50
3 ;; Author: Daniel Pfieffer <pfieffer@cix.cict.fr> January 1991
4 ;; Jim Blandy <jimb@occs.cs.oberlin.edu>
7 ;; Copyright (C) 1989 Free Software Foundation, Inc.
9 ;; This file is part of GNU Emacs.
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.
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.
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.
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
40 (define-key function-key-map "\C-a" (make-keymap))
41 (mapcar (function (lambda (key-definition)
42 (define-key function-key-map
43 (car key-definition) (nth 1 key-definition))))
45 ;; These might be set up by termcap and terminfo
60 ;; These might be set up by terminfo
94 ;; Terminfo may know about these, but X won't
95 ("\eI" [key-stab]) ;; Not an X keysym
96 ("\eJ" [key-snext]) ;; Not an X keysym
97 ("\eY" [key-clear]) ;; Not an X keysym
99 ;; These are totally strange :-)
100 ("\eW" [?\C-?]) ;; Not an X keysym
101 ("\^a\^k\^m" [funct-up]) ;; Not an X keysym
102 ("\^a\^j\^m" [funct-down]) ;; Not an X keysym
103 ("\^a\^l\^m" [funct-right]) ;; Not an X keysym
104 ("\^a\^h\^m" [funct-left]) ;; Not an X keysym
105 ("\^a\^m\^m" [funct-return]) ;; Not an X keysym
106 ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym
109 (defun enable-arrow-keys ()
110 "To be called by term-setup-hook. Overrides 6 Emacs standard keys
111 whose functions are then typed as follows:
114 LFD Funct Return, some modes override down-arrow via LFD
117 M-r M-x move-to-window-line, Funct up-arrow or down-arrow are similar
120 (mapcar (function (lambda (key-definition)
121 (global-set-key (car key-definition)
122 (nth 1 key-definition))))
123 ;; By unsetting C-a and then binding it to a prefix, we
124 ;; allow the rest of the function keys which start with C-a
132 (fset 'enable-arrow-keys nil))
135 ;;; Miscellaneous hacks
137 ;;; This is an ugly hack for a nasty problem:
138 ;;; Wyse 50 takes one character cell to store video attributes (which seems to
139 ;;; explain width 79 rather than 80, column 1 is not used!!!).
140 ;;; On killing (C-x C-c) the end inverse code (on column 1 of line 24)
141 ;;; of the mode line is overwritten AFTER all the y-or-n questions.
142 ;;; This causes the attribute to remain in effect until the mode line has
143 ;;; scrolled of the screen. Suspending (C-z) does not cause this problem.
144 ;;; On such terminals, Emacs should sacrifice the first and last character of
145 ;;; each mode line, rather than a whole screen column!
146 (setq kill-emacs-hook
147 (function (lambda () (interactive)
148 (send-string-to-terminal
149 (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))
151 ;;; wyse50.el ends here