Mercurial > hg > xemacs-beta
annotate lisp/term/wyse50.el @ 4967:0d4c9d0f6a8d
rewrite dynarr code
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-03 Ben Wing <ben@xemacs.org>
* device-x.c (x_get_resource_prefix):
* device-x.c (Fx_get_resource):
* device-x.c (Fx_get_resource_prefix):
* device-x.c (Fx_put_resource):
* dialog-msw.c:
* dialog-msw.c (handle_question_dialog_box):
* dired-msw.c (mswindows_sort_files):
* dired-msw.c (mswindows_get_files):
* extents.c (extent_fragment_sort_by_priority):
* extents.c (Fset_extent_parent):
* file-coding.c (coding_reader):
* file-coding.c (coding_writer):
* file-coding.c (gzip_convert):
* frame.c (generate_title_string):
* gutter.c (calculate_gutter_size_from_display_lines):
* indent.c (vmotion_1):
* lread.c (read_bit_vector):
* mule-coding.c (iso2022_decode):
* rangetab.c:
* rangetab.c (Fcopy_range_table):
* rangetab.c (Fget_range_table):
* rangetab.c (unified_range_table_copy_data):
* redisplay-msw.c (mswindows_output_string):
* redisplay-output.c (output_display_line):
* redisplay-output.c (redisplay_move_cursor):
* redisplay-output.c (redisplay_clear_bottom_of_window):
* redisplay-tty.c (tty_output_ichar_dynarr):
* redisplay-tty.c (set_foreground_to):
* redisplay-tty.c (set_background_to):
* redisplay-xlike-inc.c (XLIKE_output_string):
* redisplay.c (redisplay_window_text_width_string):
* redisplay.c (redisplay_text_width_string):
* redisplay.c (create_text_block):
* redisplay.c (SET_CURRENT_MODE_CHARS_PIXSIZE):
* redisplay.c (generate_fstring_runes):
* redisplay.c (regenerate_modeline):
* redisplay.c (ensure_modeline_generated):
* redisplay.c (real_current_modeline_height):
* redisplay.c (create_string_text_block):
* redisplay.c (regenerate_window):
* redisplay.c (REGEN_INC_FIND_START_END):
* redisplay.c (point_visible):
* redisplay.c (redisplay_window):
* redisplay.c (mark_glyph_block_dynarr):
* redisplay.c (line_start_cache_start):
* redisplay.c (start_with_line_at_pixpos):
* redisplay.c (update_line_start_cache):
* redisplay.c (glyph_to_pixel_translation):
* redisplay.c (pixel_to_glyph_translation):
* sysdep.c (qxe_readdir):
* text.c (dfc_convert_to_external_format):
* text.c (dfc_convert_to_internal_format):
* toolbar-common.c (common_output_toolbar_button):
* window.c (window_modeline_height):
* window.c (Fwindow_last_line_visible_height):
* window.c (window_displayed_height):
* window.c (window_scroll):
* window.c (get_current_pixel_pos):
Use Dynarr_begin() in place of Dynarr_atp (foo, 0).
* dynarr.c (Dynarr_realloc):
* dynarr.c (Dynarr_lisp_realloc):
* dynarr.c (Dynarr_resize):
* dynarr.c (Dynarr_insert_many):
* dynarr.c (Dynarr_delete_many):
* dynarr.c (Dynarr_memory_usage):
* dynarr.c (stack_like_malloc):
* dynarr.c (stack_like_free):
* lisp.h:
* lisp.h (DECLARE_DYNARR_LISP_IMP):
* lisp.h (XD_DYNARR_DESC):
* lisp.h (Dynarr_pop):
* gutter.c (output_gutter):
* redisplay-output.c (sync_rune_structs):
* redisplay-output.c (redisplay_output_window):
Redo the dynarr code, add greater checks.
Rename the `len', `largest' and `max' members to `len_',
`largest_' and `max_' to try and catch existing places that might
directly modify these values. Make new accessors Dynarr_largest()
and Dynarr_max() and make them and existing Dynarr_length() be
non-lvalues by adding '+ 0' to them; fix a couple of places in the
redisplay code that tried to modify the length directly by setting
Dynarr_length(). Use the accessors whenever possible even in the
dynarr code itself. The accessors also verify that 0 <= len <=
largest <= max. Rename settor function Dynarr_set_size() to
Dynarr_set_length() and use it more consistently; also create
lower-level Dynarr_set_length_1(). This latter function should be
the only function that directly modifies the `len_' member of a
Dynarr, and in the process makes sure that the `largest' value is
kept correct.
Consistently use ERROR_CHECK_STRUCTURES instead of
ERROR_CHECK_TYPES for error-checking code. Reintroduce the
temporarily disabled verification code on the positions of
Dynarr_at(), Dynarr_atp() and Dynarr_atp_past_end().
Also create Dynarr_resize_if() in place of a repeated
code fragment. Clean up all the functions that modify Dynarrs to
use the new macros and functions and verify the correctness of the
Dynarr both before and after the change.
Note that there are two kinds of verification -- one for accessing
and one for modifying. The difference is that the modify
verification additionally checks to make sure that the Dynarr
isn't locked. (This is used in redisplay to check for problems
with reentrancy.)
* lrecord.h: Move XD_DYNARR_DESC to lisp.h, grouping with the dynarr code.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 03 Feb 2010 20:51:18 -0600 |
parents | e29fcfd8df5f |
children | 308d34e9f07d |
rev | line source |
---|---|
0 | 1 ;;; wyse50.el --- terminal support code for Wyse 50 |
2 | |
3 ;; Copyright (C) 1989, 1993, 1994 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: Daniel Pfieffer <pfieffer@cix.cict.fr> January 1991 | |
6 ;; Jim Blandy <jimb@occs.cs.oberlin.edu> | |
7 ;; Keywords: terminals | |
8 | |
9 ;;; This file is part of GNU Emacs. | |
10 ;;; | |
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. | |
15 ;;; | |
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. | |
20 ;;; | |
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. | |
24 | |
25 ;;; Commentary: | |
26 | |
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. | |
31 ;; | |
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 | |
35 ;; enable the arrows. | |
36 | |
37 ;;; Code: | |
38 | |
39 (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
|
40 (mapc (function (lambda (key-definition) |
0 | 41 (define-key function-key-map |
42 (car key-definition) (nth 1 key-definition)))) | |
43 '( | |
44 ;; These might be set up by termcap and terminfo | |
45 ("\C-k" [up]) | |
46 ("\C-j" [down]) | |
47 ("\C-l" [right]) | |
48 ("\C-h" [left]) | |
49 ("\^a@\^m" [f1]) | |
50 ("\^aA\^m" [f2]) | |
51 ("\^aB\^m" [f3]) | |
52 ("\^aC\^m" [f4]) | |
53 ("\^aD\^m" [f5]) | |
54 ("\^aE\^m" [f6]) | |
55 ("\^aF\^m" [f7]) | |
56 ("\^aG\^m" [f8]) | |
57 ("\^aH\^m" [f9]) | |
58 | |
59 ;; These might be set up by terminfo | |
60 ("\eK" [next]) | |
61 ("\eT" [clearline]) | |
62 ("\^^" [home]) | |
63 ("\e\^^" [end]) | |
64 ("\eQ" [insert]) | |
65 ("\eE" [insertline]) | |
66 ("\eR" [deleteline]) | |
67 ("\eP" [print]) | |
68 ("\er" [replace]) | |
69 ("\^aI\^m" [f10]) | |
70 ("\^aJ\^m" [f11]) | |
71 ("\^aK\^m" [f12]) | |
72 ("\^aL\^m" [f13]) | |
73 ("\^aM\^m" [f14]) | |
74 ("\^aN\^m" [f15]) | |
75 ("\^aO\^m" [f16]) | |
76 ("\^a`\^m" [f17]) | |
77 ("\^aa\^m" [f18]) | |
78 ("\^ab\^m" [f19]) | |
79 ("\^ac\^m" [f20]) | |
80 ("\^ad\^m" [f21]) | |
81 ("\^ae\^m" [f22]) | |
82 ("\^af\^m" [f23]) | |
83 ("\^ag\^m" [f24]) | |
84 ("\^ah\^m" [f25]) | |
85 ("\^ai\^m" [f26]) | |
86 ("\^aj\^m" [f27]) | |
87 ("\^ak\^m" [f28]) | |
88 ("\^al\^m" [f29]) | |
89 ("\^am\^m" [f30]) | |
90 ("\^an\^m" [f31]) | |
91 ("\^ao\^m" [f32]) | |
92 | |
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 | |
97 | |
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 | |
106 )) | |
107 | |
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: | |
111 C-a Funct Left-arrow | |
112 C-h M-? | |
113 LFD Funct Return, some modes override down-arrow via LFD | |
114 C-k CLR Line | |
115 C-l Scrn CLR | |
116 M-r M-x move-to-window-line, Funct up-arrow or down-arrow are similar | |
117 " | |
118 (interactive) | |
4783
e29fcfd8df5f
Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
0
diff
changeset
|
119 (mapc (function (lambda (key-definition) |
0 | 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 | |
124 ;; to be recognized. | |
125 '(("\C-a" nil) | |
126 ("\C-k" nil) | |
127 ("\C-j" nil) | |
128 ("\C-l" nil) | |
129 ("\C-h" nil) | |
130 ("\er" nil))) | |
131 (fset 'enable-arrow-keys nil)) | |
132 | |
133 | |
134 ;;; Miscellaneous hacks | |
135 | |
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"))))) | |
149 | |
150 ;;; wyse50.el ends here |