annotate lisp/term/wyse50.el @ 2340:91a83e231f92

[xemacs-hg @ 2004-10-19 17:18:59 by james] Mark more unused parameters.
author james
date Tue, 19 Oct 2004 17:19:07 +0000
parents 376386a54a3c
children e29fcfd8df5f
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;; along with GNU Emacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; Rewritten for Emacs 19 by jimb, January 1992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; Cleaned up for new terminal package conventions by esr, March 1993
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; Should work well for Televideo TVI 925 although it's overkill.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; The Wyse50 is ergonomically wonderful, but its escape-sequence design sucks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; 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
34 ;; feed (!!). Thus, you have to unbind some commonly-used Emacs keys to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; enable the arrows.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (define-key function-key-map "\C-a" (make-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (mapcar (function (lambda (key-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (define-key function-key-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (car key-definition) (nth 1 key-definition))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; These might be set up by termcap and terminfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ("\C-k" [up])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ("\C-j" [down])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ("\C-l" [right])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ("\C-h" [left])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ("\^a@\^m" [f1])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ("\^aA\^m" [f2])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ("\^aB\^m" [f3])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ("\^aC\^m" [f4])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ("\^aD\^m" [f5])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ("\^aE\^m" [f6])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ("\^aF\^m" [f7])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ("\^aG\^m" [f8])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ("\^aH\^m" [f9])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;; These might be set up by terminfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ("\eK" [next])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ("\eT" [clearline])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ("\^^" [home])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ("\e\^^" [end])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ("\eQ" [insert])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ("\eE" [insertline])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ("\eR" [deleteline])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ("\eP" [print])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ("\er" [replace])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ("\^aI\^m" [f10])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ("\^aJ\^m" [f11])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ("\^aK\^m" [f12])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ("\^aL\^m" [f13])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ("\^aM\^m" [f14])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ("\^aN\^m" [f15])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ("\^aO\^m" [f16])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ("\^a`\^m" [f17])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ("\^aa\^m" [f18])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ("\^ab\^m" [f19])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ("\^ac\^m" [f20])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ("\^ad\^m" [f21])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ("\^ae\^m" [f22])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ("\^af\^m" [f23])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ("\^ag\^m" [f24])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ("\^ah\^m" [f25])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ("\^ai\^m" [f26])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ("\^aj\^m" [f27])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ("\^ak\^m" [f28])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ("\^al\^m" [f29])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ("\^am\^m" [f30])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ("\^an\^m" [f31])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ("\^ao\^m" [f32])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;; Terminfo may know about these, but X won't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ("\eI" [key-stab]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ("\eJ" [key-snext]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ("\eY" [key-clear]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ;; These are totally strange :-)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ("\eW" [?\C-?]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ("\^a\^k\^m" [funct-up]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ("\^a\^j\^m" [funct-down]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ("\^a\^l\^m" [funct-right]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ("\^a\^h\^m" [funct-left]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ("\^a\^m\^m" [funct-return]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (defun enable-arrow-keys ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 "To be called by term-setup-hook. Overrides 6 Emacs standard keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 whose functions are then typed as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 C-a Funct Left-arrow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 C-h M-?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 LFD Funct Return, some modes override down-arrow via LFD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 C-k CLR Line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 C-l Scrn CLR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 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
117 "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (mapcar (function (lambda (key-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (global-set-key (car key-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (nth 1 key-definition))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;; By unsetting C-a and then binding it to a prefix, we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;; allow the rest of the function keys which start with C-a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; to be recognized.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 '(("\C-a" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ("\C-k" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ("\C-j" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ("\C-l" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ("\C-h" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ("\er" nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (fset 'enable-arrow-keys nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;;; Miscellaneous hacks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;;; This is an ugly hack for a nasty problem:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ;;; Wyse 50 takes one character cell to store video attributes (which seems to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;;; explain width 79 rather than 80, column 1 is not used!!!).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;; 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
140 ;;; of the mode line is overwritten AFTER all the y-or-n questions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ;;; This causes the attribute to remain in effect until the mode line has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ;;; scrolled of the screen. Suspending (C-z) does not cause this problem.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ;;; On such terminals, Emacs should sacrifice the first and last character of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ;;; each mode line, rather than a whole screen column!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (add-hook 'kill-emacs-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (function (lambda () (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (send-string-to-terminal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ;;; wyse50.el ends here