1 ;;; wyse50.el --- terminal support code for Wyse 50
3 ;; Copyright (C) 1989, 1993, 1994 Free Software Foundation, Inc.
5 ;; Author: Daniel Pfieffer <pfieffer@cix.cict.fr> January 1991
6 ;; Jim Blandy <jimb@occs.cs.oberlin.edu>
9 ;;; This file is part of GNU Emacs.
11 ;;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;;; it under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 2, or (at your option)
14 ;;; any later version.
16 ;;; GNU Emacs is distributed in the hope that it will be useful,
17 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Emacs; see the file COPYING. If not, write to
23 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 ;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
28 ;; Rewritten for Emacs 19 by jimb, January 1992
29 ;; Cleaned up for new terminal package conventions by esr, March 1993
30 ;; Should work well for Televideo TVI 925 although it's overkill.
32 ;; The Wyse50 is ergonomically wonderful, but its escape-sequence design sucks
33 ;; rocks. The left-arrow key emits a backspace (!) and the down-arrow a line
34 ;; feed (!!). Thus, you have to unbind some commonly-used Emacs keys to
39 (define-key function-key-map "\C-a" (make-keymap))
40 (mapcar (function (lambda (key-definition)
41 (define-key function-key-map
42 (car key-definition) (nth 1 key-definition))))
44 ;; These might be set up by termcap and terminfo
59 ;; These might be set up by terminfo
93 ;; Terminfo may know about these, but X won't
94 ("\eI" [key-stab]) ;; Not an X keysym
95 ("\eJ" [key-snext]) ;; Not an X keysym
96 ("\eY" [key-clear]) ;; Not an X keysym
98 ;; These are totally strange :-)
99 ("\eW" [?\C-?]) ;; Not an X keysym
100 ("\^a\^k\^m" [funct-up]) ;; Not an X keysym
101 ("\^a\^j\^m" [funct-down]) ;; Not an X keysym
102 ("\^a\^l\^m" [funct-right]) ;; Not an X keysym
103 ("\^a\^h\^m" [funct-left]) ;; Not an X keysym
104 ("\^a\^m\^m" [funct-return]) ;; Not an X keysym
105 ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym
108 (defun enable-arrow-keys ()
109 "To be called by term-setup-hook. Overrides 6 Emacs standard keys
110 whose functions are then typed as follows:
113 LFD Funct Return, some modes override down-arrow via LFD
116 M-r M-x move-to-window-line, Funct up-arrow or down-arrow are similar
119 (mapcar (function (lambda (key-definition)
120 (global-set-key (car key-definition)
121 (nth 1 key-definition))))
122 ;; By unsetting C-a and then binding it to a prefix, we
123 ;; allow the rest of the function keys which start with C-a
131 (fset 'enable-arrow-keys nil))
134 ;;; Miscellaneous hacks
136 ;;; This is an ugly hack for a nasty problem:
137 ;;; Wyse 50 takes one character cell to store video attributes (which seems to
138 ;;; explain width 79 rather than 80, column 1 is not used!!!).
139 ;;; On killing (C-x C-c) the end inverse code (on column 1 of line 24)
140 ;;; of the mode line is overwritten AFTER all the y-or-n questions.
141 ;;; This causes the attribute to remain in effect until the mode line has
142 ;;; scrolled of the screen. Suspending (C-z) does not cause this problem.
143 ;;; On such terminals, Emacs should sacrifice the first and last character of
144 ;;; each mode line, rather than a whole screen column!
145 (add-hook 'kill-emacs-hook
146 (function (lambda () (interactive)
147 (send-string-to-terminal
148 (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))
150 ;;; wyse50.el ends here