1 ;;; wyse50.el --- terminal support code for Wyse 50 -*- no-byte-compile: t -*-
3 ;; Copyright (C) 1989, 1993, 1994, 2002, 2003, 2004,
4 ;; 2005 Free Software Foundation, Inc.
6 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>,
7 ;; Jim Blandy <jimb@occs.cs.oberlin.edu>
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
29 ;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
30 ;; Rewritten for Emacs 19 by jimb, January 1992
31 ;; Cleaned up for new terminal package conventions by esr, March 1993
32 ;; Should work well for Televideo TVI 925 although it's overkill.
34 ;; The Wyse50 is ergonomically wonderful, but its escape-sequence design sucks
35 ;; rocks. The left-arrow key emits a backspace (!) and the down-arrow a line
36 ;; feed (!!). Thus, you have to unbind some commonly-used Emacs keys to
41 (defun terminal-init-wyse50 ()
42 "Terminal initialization function for wyse50."
43 (define-key function-key-map "\C-a" (make-keymap))
44 (mapcar (function (lambda (key-definition)
45 (define-key function-key-map
46 (car key-definition) (nth 1 key-definition))))
48 ;; These might be set up by termcap and terminfo
63 ;; These might be set up by terminfo
97 ;; Terminfo may know about these, but X won't
98 ("\eI" [key-stab]) ;; Not an X keysym
99 ("\eJ" [key-snext]) ;; Not an X keysym
100 ("\eY" [key-clear]) ;; Not an X keysym
102 ;; These are totally strange :-)
103 ("\eW" [?\C-?]) ;; Not an X keysym
104 ("\^a\^k\^m" [funct-up]) ;; Not an X keysym
105 ("\^a\^j\^m" [funct-down]) ;; Not an X keysym
106 ("\^a\^l\^m" [funct-right]) ;; Not an X keysym
107 ("\^a\^h\^m" [funct-left]) ;; Not an X keysym
108 ("\^a\^m\^m" [funct-return]) ;; Not an X keysym
109 ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym
112 ;; Miscellaneous hacks
114 ;; This is an ugly hack for a nasty problem:
115 ;; Wyse 50 takes one character cell to store video attributes (which seems to
116 ;; explain width 79 rather than 80, column 1 is not used!!!).
117 ;; On killing (C-x C-c) the end inverse code (on column 1 of line 24)
118 ;; of the mode line is overwritten AFTER all the y-or-n questions.
119 ;; This causes the attribute to remain in effect until the mode line has
120 ;; scrolled of the screen. Suspending (C-z) does not cause this problem.
121 ;; On such terminals, Emacs should sacrifice the first and last character of
122 ;; each mode line, rather than a whole screen column!
123 (add-hook 'kill-emacs-hook
124 (function (lambda () (interactive)
125 (send-string-to-terminal
126 (concat "\ea23R" (1+ (frame-width)) "C\eG0"))))))
128 (defun enable-arrow-keys ()
129 "To be called by term-setup-hook. Overrides 6 Emacs standard keys
130 whose functions are then typed as follows:
133 LFD Funct Return, some modes override down-arrow via LFD
136 M-r M-x move-to-window-line, Funct up-arrow or down-arrow are similar
139 (mapcar (function (lambda (key-definition)
140 (global-set-key (car key-definition)
141 (nth 1 key-definition))))
142 ;; By unsetting C-a and then binding it to a prefix, we
143 ;; allow the rest of the function keys which start with C-a
151 (fset 'enable-arrow-keys nil))
153 ;;; arch-tag: b6a05d37-eead-4cf6-b997-0f956c68881c
154 ;;; wyse50.el ends here