From: howard@hasse.ericsson.se (Howard Gayle) Newsgroups: alt.sources Subject: GNU Emacs 8-bit mods part 05 of 12 Message-ID: <1990Apr5.133649.8863@ericsson.se> Date: 5 Apr 90 13:36:49 GMT *** ../18.55/src/abbrev.c Fri Dec 5 10:13:58 1986 --- src/abbrev.c Thu Apr 5 09:08:59 1990 *************** *** 1,5 **** /* Primitives for word-abbrev mode. ! Copyright (C) 1985, 1986 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Primitives for word-abbrev mode. ! Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,30 **** --- 19,37 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #include "config.h" #include #undef NULL #include "lisp.h" + #include "casetab.h" + #include "chartab.h" #include "commands.h" #include "buffer.h" + #include "transtab.h" #include "window.h" /* An abbrev table is an obarray. *************** *** 222,228 **** CHECK_NUMBER_COERCE_MARKER (tem, 0); wordstart = XINT (tem); Vabbrev_start_location = Qnil; ! if (CharAt (wordstart) == '-') del_range (wordstart, wordstart + 1); } else --- 229,235 ---- CHECK_NUMBER_COERCE_MARKER (tem, 0); wordstart = XINT (tem); Vabbrev_start_location = Qnil; ! if (CharAt (wordstart) == HYPHEN) del_range (wordstart, wordstart + 1); } else *************** *** 234,243 **** for (idx = wordstart; idx < point; idx++) { register int c = CharAt (idx); ! if (UPPERCASEP (c)) ! c = DOWNCASE (c), uccount++; ! else if (! NOCASEP (c)) ! lccount++; *p++ = c; } --- 241,256 ---- for (idx = wordstart; idx < point; idx++) { register int c = CharAt (idx); ! switch (LOCAL_CASE (c)) ! { ! case lowercase_e: ! lccount++; ! break; ! case uppercase_e: ! c = LOCAL_TOLOWER (c); ! uccount++; ! break; ! } *p++ = c; } *** ../18.55/src/alloc.c Mon Feb 13 11:23:35 1989 --- src/alloc.c Thu Apr 5 09:08:58 1990 *************** *** 1,5 **** /* Storage allocation and gc for GNU Emacs Lisp interpreter. ! Copyright (C) 1985, 1986 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Storage allocation and gc for GNU Emacs Lisp interpreter. ! Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,28 **** --- 19,33 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #include "config.h" #include "lisp.h" #ifndef standalone #include "buffer.h" + #include "etctab.h" #include "window.h" #endif *************** *** 1058,1063 **** --- 1063,1081 ---- mark_buffer (obj); break; + case Lisp_Casetab: + case Lisp_Chartab: + case Lisp_Sorttab: + case Lisp_Transtab: + { + register struct Lisp_Etctab *ptr = XETCTAB (obj); + register int mark = ptr->etc_ser; + + if (mark & ARRAY_MARK_FLAG) break; /* Already marked */ + ptr->etc_ser |= ARRAY_MARK_FLAG; /* Else mark it */ + } + break; + case Lisp_Int: case Lisp_Void: case Lisp_Subr: *************** *** 1095,1100 **** --- 1113,1138 ---- if (buffer->syntax_table_v) mark_object (&tem); + XSET (tem, Lisp_Casetab, buffer->case_table_v); + if (buffer->case_table_v) + mark_object (&tem); + + XSET (tem, Lisp_Transtab, buffer->upcase_table_v); + if (buffer->upcase_table_v) + mark_object (&tem); + + XSET (tem, Lisp_Transtab, buffer->downcase_table_v); + if (buffer->downcase_table_v) + mark_object (&tem); + + XSET (tem, Lisp_Sorttab, buffer->case_distinct_table_v); + if (buffer->case_distinct_table_v) + mark_object (&tem); + + XSET (tem, Lisp_Sorttab, buffer->case_fold_table_v); + if (buffer->case_fold_table_v) + mark_object (&tem); + for (ptr = &buffer->name + 1; (char *)ptr < (char *)buffer + sizeof (struct buffer); ptr++) *************** *** 1228,1233 **** --- 1266,1292 ---- } } + /* Free all unmarked etc tables */ + { + register struct Lisp_Etctab *p = all_etc_tables, *prev = 0, *next = 0; + + while (p) + if (!(p->etc_ser & ARRAY_MARK_FLAG)) + { + if (prev) + prev->etc_next = p->etc_next; + else + all_etc_tables = p->etc_next; + next = p->etc_next; + free (p); + p = next; + } + else + { + p->etc_ser &= ~ARRAY_MARK_FLAG; + prev = p, p = p->etc_next; + } + } #endif standalone /* Free all unmarked vectors */ *** ../18.55/src/buffer.c Fri Jul 21 00:36:02 1989 --- src/buffer.c Thu Apr 5 09:08:55 1990 *************** *** 1,5 **** /* Buffer manipulation primitives for GNU Emacs. ! Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Buffer manipulation primitives for GNU Emacs. ! Copyright (C) 1985, 1986, 1987, 1988, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,24 **** --- 19,28 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #include #ifndef MAXPATHLEN *************** *** 31,36 **** --- 35,41 ---- #endif #include "config.h" #include "lisp.h" + #include "chartab.h" #include "window.h" #include "commands.h" #include "buffer.h" *************** *** 257,263 **** b->mode_name = QSFundamental; b->minor_modes = Qnil; b->syntax_table_v = XVECTOR (Vstandard_syntax_table); ! /* Reset all per-buffer variables to their defaults. */ b->local_var_alist = Qnil; b->local_var_flags = 0; --- 262,272 ---- b->mode_name = QSFundamental; b->minor_modes = Qnil; b->syntax_table_v = XVECTOR (Vstandard_syntax_table); ! b->case_table_v = buffer_defaults.case_table_v; ! b->downcase_table_v = buffer_defaults.downcase_table_v; ! b->upcase_table_v = buffer_defaults.upcase_table_v; ! b->case_distinct_table_v = buffer_defaults.case_distinct_table_v; ! b->case_fold_table_v = buffer_defaults.case_fold_table_v; /* Reset all per-buffer variables to their defaults. */ b->local_var_alist = Qnil; b->local_var_flags = 0; *************** *** 1090,1105 **** /* real setup is done in loaddefs.el */ buffer_defaults.mode_line_format = build_string ("%-"); buffer_defaults.abbrev_mode = Qnil; buffer_defaults.overwrite_mode = Qnil; buffer_defaults.case_fold_search = Qt; buffer_defaults.auto_fill_hook = Qnil; buffer_defaults.selective_display = Qnil; - buffer_defaults.selective_display_ellipses = Qt; buffer_defaults.abbrev_table = Qnil; XFASTINT (buffer_defaults.tab_width) = 8; buffer_defaults.truncate_lines = Qnil; - buffer_defaults.ctl_arrow = Qt; XFASTINT (buffer_defaults.fill_column) = 70; XFASTINT (buffer_defaults.left_margin) = 0; --- 1099,1113 ---- /* real setup is done in loaddefs.el */ buffer_defaults.mode_line_format = build_string ("%-"); buffer_defaults.abbrev_mode = Qnil; + buffer_defaults.buffer_char_table = Vctl_arrow_char_table; buffer_defaults.overwrite_mode = Qnil; buffer_defaults.case_fold_search = Qt; buffer_defaults.auto_fill_hook = Qnil; buffer_defaults.selective_display = Qnil; buffer_defaults.abbrev_table = Qnil; XFASTINT (buffer_defaults.tab_width) = 8; buffer_defaults.truncate_lines = Qnil; XFASTINT (buffer_defaults.fill_column) = 70; XFASTINT (buffer_defaults.left_margin) = 0; *************** *** 1129,1138 **** XFASTINT (buffer_local_flags.case_fold_search) = 8; XFASTINT (buffer_local_flags.auto_fill_hook) = 0x10; XFASTINT (buffer_local_flags.selective_display) = 0x20; ! XFASTINT (buffer_local_flags.selective_display_ellipses) = 0x40; XFASTINT (buffer_local_flags.tab_width) = 0x80; XFASTINT (buffer_local_flags.truncate_lines) = 0x100; ! XFASTINT (buffer_local_flags.ctl_arrow) = 0x200; XFASTINT (buffer_local_flags.fill_column) = 0x400; XFASTINT (buffer_local_flags.left_margin) = 0x800; XFASTINT (buffer_local_flags.abbrev_table) = 0x1000; --- 1137,1146 ---- XFASTINT (buffer_local_flags.case_fold_search) = 8; XFASTINT (buffer_local_flags.auto_fill_hook) = 0x10; XFASTINT (buffer_local_flags.selective_display) = 0x20; ! XFASTINT (buffer_local_flags.buffer_char_table) = 0x40; XFASTINT (buffer_local_flags.tab_width) = 0x80; XFASTINT (buffer_local_flags.truncate_lines) = 0x100; ! /* 0x200 unused. */ XFASTINT (buffer_local_flags.fill_column) = 0x400; XFASTINT (buffer_local_flags.left_margin) = 0x800; XFASTINT (buffer_local_flags.abbrev_table) = 0x1000; *************** *** 1204,1213 **** "Default abbrev-mode for buffers that do not override it.\n\ This is the same as (default-value 'abbrev-mode)."); ! DEFVAR_LISP_NOPRO ("default-ctl-arrow", ! &buffer_defaults.ctl_arrow, ! "Default ctl-arrow for buffers that do not override it.\n\ ! This is the same as (default-value 'ctl-arrow)."); DEFVAR_LISP_NOPRO ("default-truncate-lines", &buffer_defaults.truncate_lines, --- 1212,1221 ---- "Default abbrev-mode for buffers that do not override it.\n\ This is the same as (default-value 'abbrev-mode)."); ! DEFVAR_LISP_NOPRO ("default-buffer-char-table", ! &buffer_defaults.buffer_char_table, ! "Default char table for buffers that do not override it.\n\ ! This is the same as (default-value 'buffer-char-table)."); DEFVAR_LISP_NOPRO ("default-truncate-lines", &buffer_defaults.truncate_lines, *************** *** 1276,1281 **** --- 1284,1293 ---- "Non-nil turns on automatic expansion of abbrevs when inserted.\n\ Automatically becomes local when set in any fashion."); + DEFVAR_PER_BUFFER ("buffer-char-table", &bf_cur->buffer_char_table, + "Use this char table when displaying buffer.\n\ + Automatically becomes local when set in any fashion."); + DEFVAR_PER_BUFFER ("case-fold-search", &bf_cur->case_fold_search, "*Non-nil if searches should ignore case.\n\ Automatically becomes local when set in any fashion."); *************** *** 1296,1306 **** "*Distance between tab stops (for display of tab characters), in columns.\n\ Automatically becomes local when set in any fashion."); - DEFVAR_PER_BUFFER ("ctl-arrow", &bf_cur->ctl_arrow, - "*Non-nil means display control chars with uparrow.\n\ - Nil means use backslash and octal digits.\n\ - Automatically becomes local when set in any fashion."); - DEFVAR_PER_BUFFER ("truncate-lines", &bf_cur->truncate_lines, "*Non-nil means do not display continuation lines;\n\ give each line of text one screen line.\n\ --- 1308,1313 ---- *************** *** 1341,1351 **** ^M's in the file are written into files as newlines.\n\ Integer n as value means display only lines\n\ that start with less than n columns of space.\n\ - Automatically becomes local when set in any fashion."); - - DEFVAR_PER_BUFFER ("selective-display-ellipses", - &bf_cur->selective_display_ellipses, - "t means display ... on previous line when a line is invisible.\n\ Automatically becomes local when set in any fashion."); DEFVAR_PER_BUFFER ("overwrite-mode", &bf_cur->overwrite_mode, --- 1348,1353 ---- *** ../18.55/src/buffer.h Sun Feb 8 15:35:54 1987 --- src/buffer.h Thu Apr 5 09:09:17 1990 *************** *** 1,5 **** /* Header file for the buffer manipulation primitives. ! Copyright (C) 1985, 1986 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Header file for the buffer manipulation primitives. ! Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,24 **** --- 19,28 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #ifdef lint #include "undo.h" #endif /* lint */ *************** *** 74,79 **** --- 78,96 ---- struct UndoData *undodata; /* the syntax table in use */ struct Lisp_Vector *syntax_table_v; + /* The following 5 tables are implemented as Lisp strings. + For speed, the pointers to the contents are here. The Lisp + objects reappear below for garbage collection. */ + /* The case table in use: */ + struct Lisp_Casetab *case_table_v; + /* The lower case conversion table. */ + struct Lisp_Transtab *downcase_table_v; + /* The upper case conversion table. */ + struct Lisp_Transtab *upcase_table_v; + /* The translate table when case-fold-search is nil. */ + struct Lisp_Sorttab *case_distinct_table_v; + /* The translate table when case-fold-search is not nil. */ + struct Lisp_Sorttab *case_fold_table_v; /* This is a special exception -- as this slot should not be marked by gc_sweep, and as it is not lisp-accessible as *************** *** 135,152 **** Lisp_Object tab_width; Lisp_Object fill_column; Lisp_Object left_margin; ! /* Function to call when insert space past fiull column */ Lisp_Object auto_fill_hook; /* Non-nil means do not display continuation lines */ Lisp_Object truncate_lines; - /* Non-nil means display ctl chars with uparrow */ - Lisp_Object ctl_arrow; /* Non-nil means do selective display; See doc string in syms_of_buffer (buffer.c) for details. */ Lisp_Object selective_display; - /* Non-nil means show ... at end of line followed by invisible lines. */ - Lisp_Object selective_display_ellipses; /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ Lisp_Object minor_modes; /* t if "self-insertion" should overwrite */ --- 152,165 ---- Lisp_Object tab_width; Lisp_Object fill_column; Lisp_Object left_margin; ! /* Function to call when insert space past full column */ Lisp_Object auto_fill_hook; /* Non-nil means do not display continuation lines */ Lisp_Object truncate_lines; /* Non-nil means do selective display; See doc string in syms_of_buffer (buffer.c) for details. */ Lisp_Object selective_display; /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ Lisp_Object minor_modes; /* t if "self-insertion" should overwrite */ *************** *** 153,158 **** --- 166,173 ---- Lisp_Object overwrite_mode; /* non-nil means abbrev mode is on. Expand abbrevs automatically. */ Lisp_Object abbrev_mode; + /* Non-nil means use this char table instead of the default. */ + Lisp_Object buffer_char_table; }; extern struct buffer *bf_cur; /* points to the current buffer */ *** ../18.55/src/casefiddle.c Sat Aug 15 02:03:10 1987 --- src/casefiddle.c Thu Apr 5 09:09:30 1990 *************** *** 1,5 **** /* GNU Emacs case conversion functions. ! Copyright (C) 1985 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* GNU Emacs case conversion functions. ! Copyright (C) 1985, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,29 **** --- 19,35 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #include "config.h" #include "lisp.h" #include "buffer.h" + #include "casetab.h" #include "commands.h" #include "syntax.h" + #include "transtab.h" enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP}; *************** *** 42,51 **** c = XINT (obj); if (c >= 0 && c <= 0400) { ! if (inword) ! XFASTINT (obj) = DOWNCASE (c); ! else if (!UPPERCASEP (c)) ! XFASTINT (obj) = UPCASE1 (c); } return obj; } --- 48,55 ---- c = XINT (obj); if (c >= 0 && c <= 0400) { ! XFASTINT (obj) = (inword ? LOCAL_TOLOWER (c) ! : LOCAL_TOUPPER (c)); } return obj; } *************** *** 56,65 **** for (i = 0; i < len; i++) { c = XSTRING (obj)->data[i]; ! if (inword) ! c = DOWNCASE (c); ! else if (!UPPERCASEP (c)) ! c = UPCASE1 (c); XSTRING (obj)->data[i] = c; if (flag == CASE_CAPITALIZE) inword = SYNTAX (c) == Sword; --- 60,66 ---- for (i = 0; i < len; i++) { c = XSTRING (obj)->data[i]; ! c = (inword ? LOCAL_TOLOWER (c) : LOCAL_TOUPPER (c)); XSTRING (obj)->data[i] = c; if (flag == CASE_CAPITALIZE) inword = SYNTAX (c) == Sword; *************** *** 114,124 **** { c = CharAt (i); if (inword && flag != CASE_CAPITALIZE_UP) ! c = DOWNCASE (c); ! else if (!UPPERCASEP (c) ! && (!inword || flag != CASE_CAPITALIZE_UP)) ! c = UPCASE1 (c); ! CharAt (i) = c; if ((int) flag >= (int) CASE_CAPITALIZE) inword = SYNTAX (c) == Sword; } --- 115,123 ---- { c = CharAt (i); if (inword && flag != CASE_CAPITALIZE_UP) ! CharAt (i) = LOCAL_TOLOWER (c); ! else if (!inword || flag != CASE_CAPITALIZE_UP) ! CharAt (i) = LOCAL_TOUPPER (c); if ((int) flag >= (int) CASE_CAPITALIZE) inword = SYNTAX (c) == Sword; } *** ../18.55/src/config.h-dist Thu Apr 21 10:18:33 1988 --- src/config.h-dist Thu Apr 5 09:09:50 1990 *************** *** 1,5 **** /* GNU Emacs site configuration template file. ! Copyright (C) 1988 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* GNU Emacs site configuration template file. ! Copyright (C) 1988, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,25 **** --- 19,29 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + /* Include here a s- file that describes the system type you are using. See the file ../etc/MACHINES for a list of systems and the names of the s- files to use for them. *************** *** 101,109 **** #ifndef PURESIZE #ifdef HAVE_X_WINDOWS ! #define PURESIZE 122000 #else ! #define PURESIZE 118000 #endif #endif --- 105,113 ---- #ifndef PURESIZE #ifdef HAVE_X_WINDOWS ! #define PURESIZE 152000 #else ! #define PURESIZE 148000 #endif #endif *** ../18.55/src/cmds.c Thu Dec 29 05:09:21 1988 --- src/cmds.c Thu Apr 5 09:10:08 1990 *************** *** 1,5 **** /* Simple built-in editing commands. ! Copyright (C) 1985 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Simple built-in editing commands. ! Copyright (C) 1985, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,26 **** --- 19,31 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #include "config.h" #include "lisp.h" + #include "chartab.h" #include "commands.h" #include "buffer.h" #include "syntax.h" *************** *** 90,100 **** } negp = count <= 0; ! pos = scan_buffer ('\n', pos2, count - negp, &shortage); if (shortage > 0 && (negp || (NumCharacters >= FirstCharacter ! && CharAt (pos - 1) != '\n'))) shortage--; SetPoint (pos); return make_number (negp ? - shortage : shortage); --- 95,105 ---- } negp = count <= 0; ! pos = scan_buffer (NEWLINE, pos2, count - negp, &shortage); if (shortage > 0 && (negp || (NumCharacters >= FirstCharacter ! && CharAt (pos - 1) != NEWLINE))) shortage--; SetPoint (pos); return make_number (negp ? - shortage : shortage); *************** *** 138,144 **** pos = point; stop = NumCharacters + 1; ! while (pos < stop && CharAt (pos) != '\n') pos++; SetPoint (pos); return Qnil; --- 143,149 ---- pos = point; stop = NumCharacters + 1; ! while (pos < stop && CharAt (pos) != NEWLINE) pos++; SetPoint (pos); return Qnil; *************** *** 214,220 **** { int flag; Lisp_Object arg; ! char c1 = '\n'; arg = Fprefix_numeric_value (arg1); --- 219,225 ---- { int flag; Lisp_Object arg; ! char c1 = NEWLINE; arg = Fprefix_numeric_value (arg1); *************** *** 229,235 **** Must avoid SelfInsert in that case since point is wrong. Luckily SelfInsert's special features all do nothing in that case. */ ! flag = point > FirstCharacter && CharAt (point - 1) == '\n'; if (flag) PointLeft (1); while (XINT (arg) > 0) --- 234,240 ---- Must avoid SelfInsert in that case since point is wrong. Luckily SelfInsert's special features all do nothing in that case. */ ! flag = point > FirstCharacter && CharAt (point - 1) == NEWLINE; if (flag) PointLeft (1); while (XINT (arg) > 0) *************** *** 237,243 **** if (flag) InsCStr (&c1, 1); else ! SelfInsert ('\n', !NULL (arg1)); XFASTINT (arg)--; /* Ok since old and new vals both nonneg */ } --- 242,248 ---- if (flag) InsCStr (&c1, 1); else ! SelfInsert (NEWLINE, !NULL (arg1)); XFASTINT (arg)--; /* Ok since old and new vals both nonneg */ } *************** *** 258,265 **** if (!NULL (bf_cur->overwrite_mode) && point <= NumCharacters ! && c != '\n' && CharAt (point) != '\n' ! && (CharAt (point) != '\t' || XINT (bf_cur->tab_width) <= 0 || !((current_column () + 1) % XFASTINT (bf_cur->tab_width)))) { --- 263,270 ---- if (!NULL (bf_cur->overwrite_mode) && point <= NumCharacters ! && c != NEWLINE && CharAt (point) != NEWLINE ! && (CharAt (point) != HTAB || XINT (bf_cur->tab_width) <= 0 || !((current_column () + 1) % XFASTINT (bf_cur->tab_width)))) { *************** *** 275,289 **** if (!NULL (tem)) hairy = 1; } ! if ((c == ' ' || c == '\n') && !noautofill && !NULL (bf_cur->auto_fill_hook) && current_column () > XFASTINT (bf_cur->fill_column)) { ! if (c1 != '\n') InsCStr (&c1, 1); call0 (bf_cur->auto_fill_hook); ! if (c1 == '\n') InsCStr (&c1, 1); hairy = 1; } --- 280,294 ---- if (!NULL (tem)) hairy = 1; } ! if ((c == ' ' || c == NEWLINE) && !noautofill && !NULL (bf_cur->auto_fill_hook) && current_column () > XFASTINT (bf_cur->fill_column)) { ! if (c1 != NEWLINE) InsCStr (&c1, 1); call0 (bf_cur->auto_fill_hook); ! if (c1 == NEWLINE) InsCStr (&c1, 1); hairy = 1; } *** ../18.55/src/data.c Sat Feb 11 07:15:57 1989 --- src/data.c Thu Apr 5 09:10:21 1990 *************** *** 1,5 **** /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. ! Copyright (C) 1985, 1986 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. ! Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,24 **** --- 19,28 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #include #include "config.h" *************** *** 67,72 **** --- 71,84 ---- pure_write_error () { error ("Attempt to modify read-only object"); + } + + void + arg_out_of_range (a1) + Lisp_Object a1; + { + while (1) + Fsignal (Qargs_out_of_range, Fcons (a1, Qnil)); } void *** ../18.55/src/dired.c Sun Apr 10 13:17:54 1988 --- src/dired.c Thu Apr 5 09:10:40 1990 *************** *** 1,5 **** /* Lisp functions for making directory listings. ! Copyright (C) 1985, 1986 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Lisp functions for making directory listings. ! Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,24 **** --- 19,28 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #include #include #include *************** *** 54,59 **** --- 58,64 ---- #include "commands.h" #include "regex.h" + #include "sorttab.h" #define min(a, b) ((a) < (b) ? (a) : (b)) *************** *** 89,97 **** CHECK_STRING (match, 3); /* Compile it now so we don't get an error after opendir */ #ifdef VMS ! compile_pattern (match, &searchbuf, (char *) downcase_table); #else ! compile_pattern (match, &searchbuf, 0); #endif } --- 94,102 ---- CHECK_STRING (match, 3); /* Compile it now so we don't get an error after opendir */ #ifdef VMS ! compile_pattern (match, &searchbuf, buffer_defaults.case_fold_table_v); #else ! compile_pattern (match, &searchbuf, NULL_SORT_TABLE); #endif } *** ../18.55/src/dispextern.h Thu Dec 11 05:39:55 1986 --- src/dispextern.h Thu Apr 5 09:10:54 1990 *************** *** 1,5 **** /* Interface definitions for display code. ! Copyright (C) 1985 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Interface definitions for display code. ! Copyright (C) 1985, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,24 **** --- 19,28 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + /* Nonzero means do not assume anything about current contents of actual terminal screen */ *************** *** 59,68 **** struct display_line { struct display_line *next; /* Chain for free lines. */ ! short length; /* the number of valid characters in body */ char highlighted; /* 1 means write this line in standout mode */ char physical; /* Mark bit for gc'ing, in update_screen */ ! char body[MScreenWidth + 4]; /* the actual text of the line */ }; /* Allocate a line structure for screen line `vpos' (origin 0) --- 63,72 ---- struct display_line { struct display_line *next; /* Chain for free lines. */ ! short length; /* the number of valid glyfs in body */ char highlighted; /* 1 means write this line in standout mode */ char physical; /* Mark bit for gc'ing, in update_screen */ ! glyf_t body[MScreenWidth + 4]; /* the actual text of the line */ }; /* Allocate a line structure for screen line `vpos' (origin 0) *** ../18.55/src/dispnew.c Sat Aug 12 18:30:37 1989 --- src/dispnew.c Thu Apr 5 09:11:07 1990 *************** *** 1,5 **** /* Newly written part of redisplay code. ! Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc. This file is part of GNU Emacs. --- 1,5 ---- /* Newly written part of redisplay code. ! Copyright (C) 1985, 1986, 1987, 1988, 1990 Free Software Foundation, Inc. This file is part of GNU Emacs. *************** *** 19,24 **** --- 19,28 ---- and this notice must be preserved on all copies. */ + /* Modified 1990 for 8-bit character support by Howard Gayle. + * See chartab.c for details. */ + + #include #include "config.h" *************** *** 55,63 **** #include "termchar.h" #include "termopts.h" #include "cm.h" - #include "dispextern.h" #include "lisp.h" #include "buffer.h" #include "window.h" #include "commands.h" --- 59,68 ---- #include "termchar.h" #include "termopts.h" #include "cm.h" #include "lisp.h" + #include "dispextern.h" #include "buffer.h" + #include "chartab.h" #include "window.h" #include "commands.h" *************** *** 178,184 **** for (i = - screen_height; i < screen_height; i++) { ! p = (struct display_line *) malloc (sizeof (struct display_line) + screen_width - MScreenWidth); if (!p) abort (); SET_LINE_NEXT (p, free_display_lines); free_display_lines = p; --- 183,191 ---- for (i = - screen_height; i < screen_height; i++) { ! p = (struct display_line *) malloc ( ! sizeof (struct display_line) + ! (screen_width - MScreenWidth) * sizeof (glyf_t)); if (!p) abort (); SET_LINE_NEXT (p, free_display_lines); free_display_lines = p; *************** *** 201,207 **** abort (); free_display_lines = LINE_NEXT (p); ! bzero (p, p->body - (char *) p); SET_LINE_NEXT (p, (struct display_line *)1); /* Mark as in use. */ free_line_count--; return p; --- 208,214 ---- abort (); free_display_lines = LINE_NEXT (p); ! bzero (p, (char *) p->body - (char *) p); SET_LINE_NEXT (p, (struct display_line *)1); /* Mark as in use. */ free_line_count--; return p; *************** *** 234,240 **** line_hash_code (p) register struct display_line *p; { ! register char *body, *end; register int h = 0; if (!p) return 0; --- 241,247 ---- line_hash_code (p) register struct display_line *p; { ! register glyf_t *body, *end; register int h = 0; if (!p) return 0; *************** *** 248,258 **** *end = 0; if (!must_write_spaces) { ! while (*body++ == ' '); body--; if (body == end) return 1; ! while (end[-1] == ' ') end--; } while (body != end) h = (h << 5) + h + *body++; --- 255,265 ---- *end = 0; if (!must_write_spaces) { ! while (*body++ == SPACEGLYF); body--; if (body == end) return 1; ! while (end[-1] == SPACEGLYF) end--; } while (body != end) h = (h << 5) + h + *body++; *************** *** 261,267 **** return 1; } ! /* Return number of characters in display_line p, except don't count leading and trailing spaces unless the terminal requires those to be explicitly output. */ --- 268,274 ---- return 1; } ! /* Return number of characters to draw display_line p, except don't count leading and trailing spaces unless the terminal requires those to be explicitly output. */ *************** *** 268,287 **** line_draw_cost (p) struct display_line *p; { ! register char *body; register int i; if (!p) return 0; ! if (must_write_spaces) ! return p->length; ! ! body = p->body - 1; ! for (i = p->length; i > 0 && body[i - 1] == ' '; i--); ! ! i -= count_blanks (p->body); ! return max (i, 0); } /* The functions on this page are the interface from xdisp.c to redisplay. --- 275,301 ---- line_draw_cost (p) struct display_line *p; { ! register glyf_t *body; ! register glyf_t *end; register int i; if (!p) return 0; ! body = p->body; ! end = body + p->length - 1; ! if (!must_write_spaces) ! { ! while ((*end == SPACEGLYF) && (end != body)) ! --end; ! if (end == body) return (0); /* All blank line. */ ! while (*body == SPACEGLYF) ! ++body; ! } ! i = 0; ! while ((body <= end) && *body) ! i += glyf_len (*body++); ! return (i); } /* The functions on this page are the interface from xdisp.c to redisplay. *************** *** 308,314 **** register int hpos; { register struct display_line *line; ! register char *p; if (vpos < 0) abort (); --- 322,328 ---- register int hpos; { register struct display_line *line; ! register glyf_t *p; if (vpos < 0) abort (); *************** *** 324,330 **** hpos -= line->length; line->length += hpos; while (--hpos >= 0) ! *p++ = ' '; } DesiredScreen[vpos + 1] = line; --- 338,344 ---- hpos -= line->length; line->length += hpos; while (--hpos >= 0) ! *p++ = SPACEGLYF; } DesiredScreen[vpos + 1] = line; *************** *** 401,407 **** { if (start > 0) { ! bcopy (l2->body, l1->body, start); if (l1->length < start && l1->length < l2->length) l1->length = min (start, l2->length); } --- 415,421 ---- { if (start > 0) { ! bcopy (l2->body, l1->body, start * sizeof (glyf_t)); if (l1->length < start && l1->length < l2->length) l1->length = min (start, l2->length); } *************** *** 408,415 **** if (l2->length > end && l1->length < l2->length) { while (l1->length < end) ! l1->body[l1->length++] = ' '; ! bcopy (l2->body + end, l1->body + end, l2->length - end); l1->length = l2->length; } } --- 422,430 ---- if (l2->length > end && l1->length < l2->length) { while (l1->length < end) ! l1->body[l1->length++] = SPACEGLYF; ! bcopy (l2->body + end, l1->body + end, ! (l2->length - end) * sizeof (glyf_t)); l1->length = l2->length; } } *************** *** 444,451 **** fin = l2->length; if (fin > end) fin = end; while (l1->length < start) ! l1->body[l1->length++] = ' '; ! bcopy (l2->body + start, l1->body + start, fin - start); l1->length = fin; } } --- 459,467 ---- fin = l2->length; if (fin > end) fin = end; while (l1->length < start) ! l1->body[l1->length++] = SPACEGLYF; ! bcopy (l2->body + start, l1->body + start, ! (fin - start) * sizeof (glyf_t)); l1->length = fin; } } *************** *** 484,491 **** see command_loop_1 where these are called. */ int ! direct_output_for_insert (c) ! int c; { register struct display_line *p = PhysScreen[cursY + 1]; #ifndef COMPILER_REGISTER_BUG --- 500,507 ---- see command_loop_1 where these are called. */ int ! direct_output_for_insert (g) ! glyf_t g; { register struct display_line *p = PhysScreen[cursY + 1]; #ifndef COMPILER_REGISTER_BUG *************** *** 514,520 **** || EQ (selected_window, minibuf_window) && minibuf_message) return 0; ! p->body[hpos] = c; unchanged_modified = bf_modified; beg_unchanged = bf_s1; XFASTINT (w->last_point) = point; --- 530,536 ---- || EQ (selected_window, minibuf_window) && minibuf_message) return 0; ! p->body[hpos] = g; unchanged_modified = bf_modified; beg_unchanged = bf_s1; XFASTINT (w->last_point) = point; *************** *** 522,528 **** XFASTINT (w->last_modified) = bf_modified; reassert_line_highlight (0, cursY); ! write_chars (p->body + hpos, 1); fflush (stdout); ++cursX; p->length = max (p->length, cursX); --- 538,544 ---- XFASTINT (w->last_modified) = bf_modified; reassert_line_highlight (0, cursY); ! write_glyfs (p->body + hpos, 1); fflush (stdout); ++cursX; p->length = max (p->length, cursX); *************** *** 787,796 **** struct display_line *old, *new; int vpos; { ! register char *obody, *nbody, *op1, *op2, *np1; int tem; int osp, nsp, m1, m2, olen, nlen; ! int save; if (old == new) return; --- 803,812 ---- struct display_line *old, *new; int vpos; { ! register glyf_t *obody, *nbody, *op1, *op2, *np1; int tem; int osp, nsp, m1, m2, olen, nlen; ! glyf_t save; if (old == new) return; *************** *** 816,824 **** olen = old->length; if (! old->highlighted) { - /* Note obody[-1] is old->physical, which is always 0 or 1. */ if (!must_write_spaces) ! while (obody[olen - 1] == ' ') olen--; } else --- 832,839 ---- olen = old->length; if (! old->highlighted) { if (!must_write_spaces) ! while ((obody[olen - 1] == SPACEGLYF) && (0 != olen)) olen--; } else *************** *** 827,833 **** spaces all the way to the screen edge so that the reverse video extends all the way across. */ while (olen < screen_width - 1) ! obody[olen++] = ' '; } } --- 842,848 ---- spaces all the way to the screen edge so that the reverse video extends all the way across. */ while (olen < screen_width - 1) ! obody[olen++] = SPACE; } } *************** *** 842,853 **** /* Pretend trailing spaces are not there at all, unless for one reason or another we must write all spaces. */ - /* We know that the previous character is the `physical' field - and it is zero or one. */ if (! new->highlighted) { if (!must_write_spaces) ! while (nbody[nlen - 1] == ' ') nlen--; } else --- 857,866 ---- /* Pretend trailing spaces are not there at all, unless for one reason or another we must write all spaces. */ if (! new->highlighted) { if (!must_write_spaces) ! while ((nbody[nlen - 1] == SPACEGLYF) && (0 != nlen)) nlen--; } else *************** *** 856,862 **** all the way to the screen edge so that the reverse video extends all the way across. */ while (nlen < screen_width - 1) ! nbody[nlen++] = ' '; } /* If there's no i/d char, quickly do the best we can without it. */ --- 869,875 ---- all the way to the screen edge so that the reverse video extends all the way across. */ while (nlen < screen_width - 1) ! nbody[nlen++] = SPACE; } /* If there's no i/d char, quickly do the best we can without it. */ *************** *** 874,880 **** (i + j >= olen || nbody[i+j] != obody[i+j])); j++); /* Output this run of non-matching chars. */ ! write_chars (nbody + i, j); i += j - 1; /* Now find the next non-match. */ } --- 887,893 ---- (i + j >= olen || nbody[i+j] != obody[i+j])); j++); /* Output this run of non-matching chars. */ ! write_glyfs (nbody + i, j); i += j - 1; /* Now find the next non-match. */ } *************** *** 891,901 **** if (!olen) { nsp = (must_write_spaces || new->highlighted) ! ? 0 : count_blanks (nbody); if (nlen > nsp) { topos (vpos, nsp); ! write_chars (nbody + nsp, nlen - nsp); } return; } --- 904,914 ---- if (!olen) { nsp = (must_write_spaces || new->highlighted) ! ? 0 : count_leading_space_glyfs (nbody); if (nlen > nsp) { topos (vpos, nsp); ! write_glyfs (nbody + nsp, nlen - nsp); } return; } *************** *** 905,913 **** nbody[nlen] = 0; /* Compute number of leading blanks in old and new contents. */ ! osp = count_blanks (obody); if (!new->highlighted) ! nsp = count_blanks (nbody); else nsp = 0; --- 918,926 ---- nbody[nlen] = 0; /* Compute number of leading blanks in old and new contents. */ ! osp = count_leading_space_glyfs (obody); if (!new->highlighted) ! nsp = count_leading_space_glyfs (nbody); else nsp = 0; *************** *** 919,925 **** if (!must_write_spaces && osp + m1 == olen) { np1 = nbody + nsp; ! while (np1[m1] == ' ') m1++; } --- 932,938 ---- if (!must_write_spaces && osp + m1 == olen) { np1 = nbody + nsp; ! while (np1[m1] == SPACEGLYF) m1++; } *************** *** 950,956 **** Is it worth it? */ tem = (nlen - nsp) - (olen - osp); ! if (m2 && tem && m2 <= DCICcost[tem]) m2 = 0; /* nsp - osp is the distance to insert or delete. --- 963,969 ---- Is it worth it? */ tem = (nlen - nsp) - (olen - osp); ! if (m2 && tem && m2 <= DCICcost (tem)) m2 = 0; /* nsp - osp is the distance to insert or delete. *************** *** 957,963 **** m1 + m2 is how much we save by doing so. Is it worth it? */ ! if (m1 + m2 && nsp != osp && m1 + m2 <= DCICcost[nsp - osp]) { m1 = 0; m2 = 0; --- 970,976 ---- m1 + m2 is how much we save by doing so. Is it worth it? */ ! if (m1 + m2 && nsp != osp && m1 + m2 <= DCICcost (nsp - osp)) { m1 = 0; m2 = 0; *************** *** 969,975 **** if (osp > nsp) { topos (vpos, nsp); ! delete_chars (osp - nsp); } else if (nsp > osp) { --- 982,988 ---- if (osp > nsp) { topos (vpos, nsp); ! delete_glyfs (osp - nsp); } else if (nsp > osp) { *************** *** 979,989 **** if (m2 && nlen < olen + nsp - osp) { topos (vpos, nlen - m2 + osp - nsp); ! delete_chars (olen + nsp - osp - nlen); olen = nlen - (nsp - osp); } topos (vpos, osp); ! insert_chars ((char *)0, nsp - osp); } olen += nsp - osp; --- 992,1002 ---- if (m2 && nlen < olen + nsp - osp) { topos (vpos, nlen - m2 + osp - nsp); ! delete_glyfs (olen + nsp - osp - nlen); olen = nlen - (nsp - osp); } topos (vpos, osp); ! insert_spaces (nsp - osp); } olen += nsp - osp; *************** *** 999,1005 **** going to be "at the margin" after the text is done) */ if (nlen == screen_width) olen = 0; ! write_chars (nbody + nsp + m1, nlen - tem); #ifdef obsolete /* the following code loses disastrously if tem == nlen. Rather than trying to fix that case, I am trying the simpler --- 1012,1018 ---- going to be "at the margin" after the text is done) */ if (nlen == screen_width) olen = 0; ! write_glyfs (nbody + nsp + m1, nlen - tem); #ifdef obsolete /* the following code loses disastrously if tem == nlen. Rather than trying to fix that case, I am trying the simpler *************** *** 1011,1035 **** if (nlen == screen_width && fast_clear_end_of_line && olen > nlen) { /* m2 must be zero, and tem must equal nsp + m1 */ ! write_chars (nbody + tem, nlen - tem - 1); clear_end_of_line (olen); olen = 0; /* Don't let it be cleared again later */ ! write_chars (nbody + nlen - 1, 1); } else ! write_chars (nbody + nsp + m1, nlen - tem); #endif } else if (nlen > olen) { ! write_chars (nbody + nsp + m1, olen - tem); ! insert_chars (nbody + nsp + m1 + olen - tem, nlen - olen); olen = nlen; } else if (olen > nlen) { ! write_chars (nbody + nsp + m1, nlen - tem); ! delete_chars (olen - nlen); olen = nlen; } } --- 1024,1048 ---- if (nlen == screen_width && fast_clear_end_of_line && olen > nlen) { /* m2 must be zero, and tem must equal nsp + m1 */ ! write_glyfs (nbody + tem, nlen - tem - 1); clear_end_of_line (olen); olen = 0; /* Don't let it be cleared again later */ ! write_glyfs (nbody + nlen - 1, 1); } else ! write_glyfs (nbody + nsp + m1, nlen - tem); #endif } else if (nlen > olen) { ! write_glyfs (nbody + nsp + m1, olen - tem); ! insert_glyfs (nbody + nsp + m1 + olen - tem, nlen - olen); olen = nlen; } else if (olen > nlen) { ! write_glyfs (nbody + nsp + m1, nlen - tem); ! delete_glyfs (olen - nlen); olen = nlen; } } *************** *** 1043,1063 **** } } ! count_blanks (str) ! char *str; { ! register char *p = str; ! while (*str++ == ' '); ! return str - p - 1; ! } ! ! count_match (str1, str2) ! char *str1, *str2; { ! register char *p1 = str1; ! register char *p2 = str2; ! while (*p1++ == *p2++); ! return p1 - str1 - 1; } DEFUN ("open-termscript", Fopen_termscript, Sopen_termscript, --- 1056,1088 ---- } } ! int ! count_leading_space_glyfs (r) ! register glyf_t *r; { ! register int i = 0; ! ! while (SPACEGLYF == *r) ! { ! ++r; ! ++i; ! } ! return (i); ! } ! ! int ! count_match (r1, r2) ! register glyf_t *r1, *r2; { ! register int i = 0; ! ! while (*r1 == *r2) ! { ! ++r1; ! ++r2; ! ++i; ! } ! return (i); } DEFUN ("open-termscript", Fopen_termscript, Sopen_termscript,