annotate lisp/term/wyse50.el @ 5402:308d34e9f07d

Changed bulk of GPLv2 or later files identified by script
author Mats Lidell <matsl@xemacs.org>
date Thu, 14 Oct 2010 17:15:20 +0200
parents e29fcfd8df5f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; wyse50.el --- terminal support code for Wyse 50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1989, 1993, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Daniel Pfieffer <pfieffer@cix.cict.fr> January 1991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Jim Blandy <jimb@occs.cs.oberlin.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Keywords: terminals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4783
diff changeset
9 ;; This file is part of XEmacs.
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4783
diff changeset
10 ;;
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4783
diff changeset
11 ;; 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
12 ;; 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
13 ;; 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
14 ;; option) any later version.
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4783
diff changeset
15 ;;
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4783
diff changeset
16 ;; 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
17 ;; 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
18 ;; 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
19 ;; for more details.
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4783
diff changeset
20 ;;
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4783
diff changeset
21 ;; You should have received a copy of 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
22 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; Rewritten for Emacs 19 by jimb, January 1992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; Cleaned up for new terminal package conventions by esr, March 1993
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; Should work well for Televideo TVI 925 although it's overkill.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; The Wyse50 is ergonomically wonderful, but its escape-sequence design sucks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; rocks. The left-arrow key emits a backspace (!) and the down-arrow a line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; feed (!!). Thus, you have to unbind some commonly-used Emacs keys to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; enable the arrows.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (define-key function-key-map "\C-a" (make-keymap))
4783
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 0
diff changeset
39 (mapc (function (lambda (key-definition)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (define-key function-key-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (car key-definition) (nth 1 key-definition))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; These might be set up by termcap and terminfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ("\C-k" [up])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ("\C-j" [down])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ("\C-l" [right])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ("\C-h" [left])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ("\^a@\^m" [f1])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ("\^aA\^m" [f2])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ("\^aB\^m" [f3])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ("\^aC\^m" [f4])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ("\^aD\^m" [f5])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ("\^aE\^m" [f6])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ("\^aF\^m" [f7])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ("\^aG\^m" [f8])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ("\^aH\^m" [f9])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; These might be set up by terminfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ("\eK" [next])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ("\eT" [clearline])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ("\^^" [home])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ("\e\^^" [end])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ("\eQ" [insert])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ("\eE" [insertline])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ("\eR" [deleteline])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ("\eP" [print])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ("\er" [replace])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ("\^aI\^m" [f10])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ("\^aJ\^m" [f11])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ("\^aK\^m" [f12])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ("\^aL\^m" [f13])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ("\^aM\^m" [f14])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ("\^aN\^m" [f15])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ("\^aO\^m" [f16])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ("\^a`\^m" [f17])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ("\^aa\^m" [f18])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ("\^ab\^m" [f19])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ("\^ac\^m" [f20])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ("\^ad\^m" [f21])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ("\^ae\^m" [f22])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ("\^af\^m" [f23])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ("\^ag\^m" [f24])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ("\^ah\^m" [f25])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ("\^ai\^m" [f26])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ("\^aj\^m" [f27])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ("\^ak\^m" [f28])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ("\^al\^m" [f29])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ("\^am\^m" [f30])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ("\^an\^m" [f31])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ("\^ao\^m" [f32])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;; Terminfo may know about these, but X won't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ("\eI" [key-stab]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ("\eJ" [key-snext]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ("\eY" [key-clear]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;; These are totally strange :-)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ("\eW" [?\C-?]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ("\^a\^k\^m" [funct-up]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ("\^a\^j\^m" [funct-down]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ("\^a\^l\^m" [funct-right]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ("\^a\^h\^m" [funct-left]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ("\^a\^m\^m" [funct-return]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (defun enable-arrow-keys ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 "To be called by term-setup-hook. Overrides 6 Emacs standard keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 whose functions are then typed as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 C-a Funct Left-arrow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 C-h M-?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 LFD Funct Return, some modes override down-arrow via LFD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 C-k CLR Line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 C-l Scrn CLR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 M-r M-x move-to-window-line, Funct up-arrow or down-arrow are similar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (interactive)
4783
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 0
diff changeset
118 (mapc (function (lambda (key-definition)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (global-set-key (car key-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (nth 1 key-definition))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;; By unsetting C-a and then binding it to a prefix, we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;; allow the rest of the function keys which start with C-a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;; to be recognized.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 '(("\C-a" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ("\C-k" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ("\C-j" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ("\C-l" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ("\C-h" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ("\er" nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (fset 'enable-arrow-keys nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;;; Miscellaneous hacks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;;; This is an ugly hack for a nasty problem:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;;; Wyse 50 takes one character cell to store video attributes (which seems to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ;;; explain width 79 rather than 80, column 1 is not used!!!).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;;; On killing (C-x C-c) the end inverse code (on column 1 of line 24)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;; of the mode line is overwritten AFTER all the y-or-n questions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;;; This causes the attribute to remain in effect until the mode line has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ;;; scrolled of the screen. Suspending (C-z) does not cause this problem.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ;;; On such terminals, Emacs should sacrifice the first and last character of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ;;; each mode line, rather than a whole screen column!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (add-hook 'kill-emacs-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (function (lambda () (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (send-string-to-terminal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ;;; wyse50.el ends here