changeset 53225:4250e7e26247

Add a level of indirection to terminal characteristics. * src/termchar.h (struct terminal): New struct. (must_write_spaces, min_padding_speed, line_ins_del_ok) (char_ins_del_ok, scroll_region_ok, scroll_region_cost) (memory_below_frame, fast_clear_end_of_line): Moved to struct terminal. (current_terminal): New variable. (CURRENT_TERMINAL, TERMINAL_*): New accessor macros. (min_padding_speed, dont_calculate_costs): Commented out (unused). * src/term.c (_current_terminal): New variable. Will be removed when true multi-tty support is implemented. * src/termopts.h (no_redraw_on_reenter): Moved here. * src/term.c (set_terminal_window, ins_del_lines, calculate_costs) (term_init): Use the accessor macros for terminal characteristics. * src/dispnew.c (line_hash_code, line_draw_cost) (direct_output_for_insert, update_frame_1, scrolling) (update_frame_line): Ditto. * src/macterm.c (mac_initialize): Ditto. * src/msdos.c (internal_terminal_init): Ditto. * src/scroll.c (calculate_scrolling, calculate_direct_scrolling) (scrolling_1, scroll_cost): Ditto. * src/sysdep.c (hft_init): Ditto. * src/w32term.c (w32_initialize): Ditto. * src/xdisp.c (try_window_id): Ditto. * src/xterm.c (x_initialize): Ditto. * etc/TODO: Add pointer to my tla archive. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-1
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 24 Dec 2003 18:55:24 +0000
parents f0eb34e60705
children dd3018b4785b
files etc/TODO src/dispnew.c src/macterm.c src/msdos.c src/scroll.c src/sysdep.c src/term.c src/termchar.h src/termopts.h src/w32term.c src/xdisp.c src/xterm.c
diffstat 12 files changed, 135 insertions(+), 104 deletions(-) [+]
line wrap: on
line diff
--- a/etc/TODO	Wed Dec 24 16:09:13 2003 +0000
+++ b/etc/TODO	Wed Dec 24 18:55:24 2003 +0000
@@ -137,7 +137,10 @@
 * Highlight rectangles (`mouse-track-rectangle-p' in XEmacs).  Already in CUA,
   but it's a valuable feature worth making more general.
 
-* Support simultaneous tty and X frames.
+* Support simultaneous tty and X frames.  [For a partial
+  implementation, see tla branch
+  lorentey@elte.hu--2004/emacs--multi-tty--0 at
+  http://lorentey.web.elte.hu/arch/2004]
 
 * Provide MIME support for Rmail using the Gnus MIME library.  [Maybe
   not now feasible, given Gnus maintenance decisions.  fx looked at
--- a/src/dispnew.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/dispnew.c	Wed Dec 24 18:55:24 2003 +0000
@@ -1397,7 +1397,7 @@
 	{
 	  int c = glyph->u.ch;
 	  int face_id = glyph->face_id;
-	  if (must_write_spaces)
+	  if (TERMINAL_MUST_WRITE_SPACES (CURRENT_TERMINAL ()))
 	    c -= SPACEGLYPH;
 	  hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c;
 	  hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id;
@@ -1429,7 +1429,7 @@
   int glyph_table_len = GLYPH_TABLE_LENGTH;
 
   /* Ignore trailing and leading spaces if we can.  */
-  if (!must_write_spaces)
+  if (!TERMINAL_MUST_WRITE_SPACES (CURRENT_TERMINAL ()))
     {
       /* Skip from the end over trailing spaces.  */
       while (end > beg && CHAR_GLYPH_SPACE_P (*(end - 1)))
@@ -3462,7 +3462,7 @@
 
   /* If we can't insert glyphs, we can use this method only
      at the end of a line.  */
-  if (!char_ins_del_ok)
+  if (!TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ()))
     if (PT != ZV && FETCH_BYTE (PT_BYTE) != '\n')
       return 0;
 
@@ -5075,7 +5075,7 @@
     }
 
   /* If we cannot insert/delete lines, it's no use trying it.  */
-  if (!line_ins_del_ok)
+  if (!TERMINAL_LINE_INS_DEL_OK (CURRENT_TERMINAL ()))
     inhibit_id_p = 1;
 
   /* See if any of the desired lines are enabled; don't compute for
@@ -5293,21 +5293,23 @@
     }
 
   /* If changed lines are few, don't allow preemption, don't scroll.  */
-  if ((!scroll_region_ok && changed_lines < baud_rate / 2400)
+  if ((!TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ())
+       && changed_lines < baud_rate / 2400)
       || unchanged_at_bottom == FRAME_LINES (frame))
     return 1;
 
   window_size = (FRAME_LINES (frame) - unchanged_at_top
 		 - unchanged_at_bottom);
 
-  if (scroll_region_ok)
+  if (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()))
     free_at_end_vpos -= unchanged_at_bottom;
-  else if (memory_below_frame)
+  else if (TERMINAL_MEMORY_BELOW_FRAME (CURRENT_TERMINAL ()))
     free_at_end_vpos = -1;
 
   /* If large window, fast terminal and few lines in common between
      current frame and desired frame, don't bother with i/d calc.  */
-  if (!scroll_region_ok && window_size >= 18 && baud_rate > 2400
+  if (!TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ())
+      && window_size >= 18 && baud_rate > 2400
       && (window_size >=
 	  10 * scrolling_max_lines_saved (unchanged_at_top,
 					  FRAME_LINES (frame) - unchanged_at_bottom,
@@ -5387,7 +5389,7 @@
   struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos);
   struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos);
   int must_write_whole_line_p;
-  int write_spaces_p = must_write_spaces;
+  int write_spaces_p = TERMINAL_MUST_WRITE_SPACES (CURRENT_TERMINAL ());
   int colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background
 			  != FACE_TTY_DEFAULT_BG_COLOR);
 
@@ -5466,7 +5468,7 @@
       nlen--;
 
   /* If there's no i/d char, quickly do the best we can without it.  */
-  if (!char_ins_del_ok)
+  if (!TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ()))
     {
       int i, j;
 
@@ -5569,7 +5571,8 @@
 
   tem = (nlen - nsp) - (olen - osp);
   if (endmatch && tem
-      && (!char_ins_del_ok || endmatch <= char_ins_del_cost (f)[tem]))
+      && (!TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ())
+          || endmatch <= char_ins_del_cost (f)[tem]))
     endmatch = 0;
 
   /* nsp - osp is the distance to insert or delete.
@@ -5578,7 +5581,7 @@
      Is it worth it?  */
 
   if (nsp != osp
-      && (!char_ins_del_ok
+      && (!TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ())
 	  || begmatch + endmatch <= char_ins_del_cost (f)[nsp - osp]))
     {
       begmatch = 0;
--- a/src/macterm.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/macterm.c	Wed Dec 24 18:55:24 2003 +0000
@@ -8674,12 +8674,13 @@
   redeem_scroll_bar_hook = XTredeem_scroll_bar;
   judge_scroll_bars_hook = XTjudge_scroll_bars;
 
-  scroll_region_ok = 1;         /* we'll scroll partial frames */
-  char_ins_del_ok = 1;
-  line_ins_del_ok = 1;          /* we'll just blt 'em */
-  fast_clear_end_of_line = 1;   /* X does this well */
-  memory_below_frame = 0;       /* we don't remember what scrolls
-				   off the bottom */
+  TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()) = 1; /* we'll scroll partial frames */
+  TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ()) = 1;
+  TERMINAL_LINE_INS_DEL_OK (CURRENT_TERMINAL ()) = 1; /* we'll just blt 'em */
+  TERMINAL_FAST_CLEAR_END_OF_LINE (CURRENT_TERMINAL ()) = 1; /* X does this well */
+  TERMINAL_MEMORY_BELOW_FRAME (CURRENT_TERMINAL ()) = 0; /* we don't remember what
+                                                         scrolls off the
+                                                         bottom */
   baud_rate = 19200;
 
   x_noop_count = 0;
--- a/src/msdos.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/msdos.c	Wed Dec 24 18:55:24 2003 +0000
@@ -2580,7 +2580,7 @@
   set_terminal_modes_hook = IT_set_terminal_modes;
   reset_terminal_modes_hook = IT_reset_terminal_modes;
   set_terminal_window_hook = IT_set_terminal_window;
-  char_ins_del_ok = 0;
+  TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ()) = 0;
 #endif
 }
 
--- a/src/scroll.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/scroll.c	Wed Dec 24 18:55:24 2003 +0000
@@ -100,7 +100,8 @@
   register struct matrix_elt *p, *p1;
   register int cost, cost1;
 
-  int lines_moved = window_size + (scroll_region_ok ? 0 : lines_below);
+  int lines_moved = window_size
+    + (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()) ? 0 : lines_below);
   /* first_insert_cost[I] is the cost of doing the first insert-line
      at the i'th line of the lines we are considering,
      where I is origin 1 (as it is below).  */
@@ -466,7 +467,8 @@
   /* Overhead of setting the scroll window, plus the extra cost
      cost of scrolling by a distance of one.  The extra cost is
      added once for consistency with the cost vectors */
-  scroll_overhead = scroll_region_cost + extra_cost;
+  scroll_overhead
+    = TERMINAL_SCROLL_REGION_COST (CURRENT_TERMINAL ()) + extra_cost;
 
   /* initialize the top left corner of the matrix */
   matrix->writecost = 0;
@@ -818,7 +820,7 @@
   matrix = ((struct matrix_elt *)
 	    alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix));
 
-  if (scroll_region_ok)
+  if (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()))
     {
       calculate_direct_scrolling (frame, matrix, window_size,
 				  unchanged_at_bottom,
@@ -914,7 +916,7 @@
   if (amount == 0)
     return 0;
 
-  if (! scroll_region_ok)
+  if (! TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()))
     limit = height;
   else if (amount > 0)
     limit += amount;
--- a/src/sysdep.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/sysdep.c	Wed Dec 24 18:55:24 2003 +0000
@@ -5126,7 +5126,8 @@
   }
   /* The HFT system on AIX doesn't optimize for scrolling, so it's really ugly
      at times.  */
-  line_ins_del_ok = char_ins_del_ok = 0;
+  TERMINAL_LINE_INS_DEL_OK (CURRENT_TERMINAL ()) = 0;
+  TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ()) = 0;
 }
 
 /* Reset the rubout key to backspace.  */
--- a/src/term.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/term.c	Wed Dec 24 18:55:24 2003 +0000
@@ -83,28 +83,13 @@
 
 Lisp_Object Vring_bell_function;
 
-/* Terminal characteristics that higher levels want to look at.
-   These are all extern'd in termchar.h */
-
-int must_write_spaces;		/* Nonzero means spaces in the text
-				   must actually be output; can't just skip
-				   over some columns to leave them blank.  */
-int min_padding_speed;		/* Speed below which no padding necessary */
-
-int line_ins_del_ok;		/* Terminal can insert and delete lines */
-int char_ins_del_ok;		/* Terminal can insert and delete chars */
-int scroll_region_ok;		/* Terminal supports setting the
-				   scroll window */
-int scroll_region_cost;		/* Cost of setting a scroll window,
-				   measured in characters */
-int memory_below_frame;		/* Terminal remembers lines
-				   scrolled off bottom */
-int fast_clear_end_of_line;	/* Terminal has a `ce' string */
+/* Terminal characteristics that higher levels want to look at. */
+static struct terminal _current_terminal;
+TERMINAL_PTR current_terminal = &_current_terminal;
 
 /* Nonzero means no need to redraw the entire frame on resuming
    a suspended Emacs.  This is useful on terminals with multiple pages,
    where one page is used for Emacs and another for all else. */
-
 int no_redraw_on_reenter;
 
 /* Hook functions that you can set to snap out the functions in this file.
@@ -505,7 +490,7 @@
   if (FRAME_TERMCAP_P (updating_frame))
     {
       specified_window = size ? size : FRAME_LINES (updating_frame);
-      if (scroll_region_ok)
+      if (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()))
 	set_scroll_region (0, specified_window);
     }
   else
@@ -1151,9 +1136,11 @@
   /* If the lines below the deletion are blank lines coming
      out of the end of the window, don't bother,
      as there will be a matching inslines later that will flush them. */
-  if (scroll_region_ok && vpos + i >= specified_window)
+  if (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ())
+      && vpos + i >= specified_window)
     return;
-  if (!memory_below_frame && vpos + i >= FRAME_LINES (sf))
+  if (!TERMINAL_MEMORY_BELOW_FRAME (CURRENT_TERMINAL ())
+      && vpos + i >= FRAME_LINES (sf))
     return;
 
   if (multi)
@@ -1186,7 +1173,9 @@
       set_scroll_region (0, specified_window);
     }
 
-  if (!scroll_region_ok && memory_below_frame && n < 0)
+  if (!TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ())
+      && TERMINAL_MEMORY_BELOW_FRAME (CURRENT_TERMINAL ())
+      && n < 0)
     {
       cursor_to (FRAME_LINES (sf) + n, 0);
       clear_to_end ();
@@ -1317,7 +1306,7 @@
 
   FRAME_COST_BAUD_RATE (frame) = baud_rate;
 
-  scroll_region_cost = string_cost (f);
+  TERMINAL_SCROLL_REGION_COST (CURRENT_TERMINAL ()) = string_cost (f);
 
   /* These variables are only used for terminal stuff.  They are allocated
      once for the terminal frame of X-windows emacs, but not used afterwards.
@@ -2185,15 +2174,15 @@
   delete_in_insert_mode = 1;
 
   UseTabs = 0;
-  scroll_region_ok = 0;
+  TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()) = 0;
 
   /* Seems to insert lines when it's not supposed to, messing
      up the display.  In doing a trace, it didn't seem to be
      called much, so I don't think we're losing anything by
      turning it off.  */
 
-  line_ins_del_ok = 0;
-  char_ins_del_ok = 1;
+  TERMINAL_LINE_INS_DEL_OK (CURRENT_TERMINAL ()) = 0;
+  TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ()) = 1;
 
   baud_rate = 19200;
 
@@ -2346,9 +2335,9 @@
   /* Since we make MagicWrap terminals look like AutoWrap, we need to have
      the former flag imply the latter.  */
   AutoWrap = MagicWrap || tgetflag ("am");
-  memory_below_frame = tgetflag ("db");
+  TERMINAL_MEMORY_BELOW_FRAME (CURRENT_TERMINAL ()) = tgetflag ("db");
   TF_hazeltine = tgetflag ("hz");
-  must_write_spaces = tgetflag ("in");
+  TERMINAL_MUST_WRITE_SPACES (CURRENT_TERMINAL ()) = tgetflag ("in");
   meta_key = tgetflag ("km") || tgetflag ("MT");
   TF_insmode_motion = tgetflag ("mi");
   TF_standout_motion = tgetflag ("ms");
@@ -2377,7 +2366,10 @@
     fatal ("Screen size %dx%d is too small",
 	   FRAME_LINES (sf), FRAME_COLS (sf));
 
-  min_padding_speed = tgetnum ("pb");
+#if 0  /* This is not used anywhere. */
+  TERMINAL_MIN_PADDING_SPEED (CURRENT_TERMINAL ()) = tgetnum ("pb");
+#endif
+  
   TabWidth = tgetnum ("tw");
 
 #ifdef VMS
@@ -2453,7 +2445,7 @@
 
   if (!strcmp (terminal_type, "supdup"))
     {
-      memory_below_frame = 1;
+      TERMINAL_MEMORY_BELOW_FRAME (CURRENT_TERMINAL ()) = 1;
       Wcm.cm_losewrap = 1;
     }
   if (!strncmp (terminal_type, "c10", 3)
@@ -2480,7 +2472,7 @@
 	    TS_set_window = "\033v%C %C %C %C ";
 	}
       /* Termcap entry often fails to have :in: flag */
-      must_write_spaces = 1;
+      TERMINAL_MUST_WRITE_SPACES (CURRENT_TERMINAL ()) = 1;
       /* :ti string typically fails to have \E^G! in it */
       /* This limits scope of insert-char to one line.  */
       strcpy (area, TS_termcap_modes);
@@ -2543,19 +2535,22 @@
 
   UseTabs = tabs_safe_p () && TabWidth == 8;
 
-  scroll_region_ok
+  TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ())
     = (Wcm.cm_abs
        && (TS_set_window || TS_set_scroll_region || TS_set_scroll_region_1));
 
-  line_ins_del_ok = (((TS_ins_line || TS_ins_multi_lines)
-		      && (TS_del_line || TS_del_multi_lines))
-		     || (scroll_region_ok && TS_fwd_scroll && TS_rev_scroll));
-
-  char_ins_del_ok = ((TS_ins_char || TS_insert_mode
-		      || TS_pad_inserted_char || TS_ins_multi_chars)
-		     && (TS_del_char || TS_del_multi_chars));
-
-  fast_clear_end_of_line = TS_clr_line != 0;
+  TERMINAL_LINE_INS_DEL_OK (CURRENT_TERMINAL ())
+    = (((TS_ins_line || TS_ins_multi_lines)
+        && (TS_del_line || TS_del_multi_lines))
+       || (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ())
+           && TS_fwd_scroll && TS_rev_scroll));
+  
+  TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ())
+    = ((TS_ins_char || TS_insert_mode
+        || TS_pad_inserted_char || TS_ins_multi_chars)
+       && (TS_del_char || TS_del_multi_chars));
+
+  TERMINAL_FAST_CLEAR_END_OF_LINE (CURRENT_TERMINAL ()) = TS_clr_line != 0;
 
   init_baud_rate ();
   if (read_socket_hook)		/* Baudrate is somewhat */
--- a/src/termchar.h	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/termchar.h	Wed Dec 24 18:55:24 2003 +0000
@@ -18,32 +18,51 @@
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-
-/* extern EMACS_INT baud_rate; */		/* Output speed in baud */
-extern int must_write_spaces;	/* Nonzero means spaces in the text
-				   must actually be output; can't just skip
-				   over some columns to leave them blank.  */
-extern int min_padding_speed;	/* Speed below which no padding necessary */
-extern int fast_clear_end_of_line; /* Nonzero means terminal has
-				      command for this */
+struct terminal
+{
+  
+  /* EMACS_INT baud_rate; */	/* Output speed in baud */
+  int must_write_spaces;	/* Nonzero means spaces in the text must
+				   actually be output; can't just skip over
+				   some columns to leave them blank.  */
+  int fast_clear_end_of_line;   /* Nonzero means terminal has a `ce' string */
+  
+  int line_ins_del_ok;          /* Terminal can insert and delete lines */
+  int char_ins_del_ok;          /* Terminal can insert and delete chars */
+  int scroll_region_ok;         /* Terminal supports setting the scroll
+                                   window */
+  int scroll_region_cost;	/* Cost of setting the scroll window,
+                                   measured in characters. */
+  int memory_below_frame;	/* Terminal remembers lines scrolled
+                                   off bottom */
 
-extern int line_ins_del_ok;	/* Terminal can insert and delete lines */
-extern int char_ins_del_ok;	/* Terminal can insert and delete chars */
-extern int scroll_region_ok;	/* Terminal supports setting the scroll
-				   window */
-extern int scroll_region_cost;	/* Cost of setting the scroll window,
-				   measured in characters */
-extern int memory_below_frame;	/* Terminal remembers lines scrolled
-				   off bottom */
-extern int fast_clear_end_of_line; /* Terminal has a `ce' string */
+#if 0  /* These are not used anywhere. */
+  int min_padding_speed;	/* Speed below which no padding necessary. */
+  int dont_calculate_costs;     /* Nonzero means don't bother computing
+                                   various cost tables; we won't use them. */
+#endif
+};
+
+typedef struct terminal *TERMINAL_PTR;
+
+extern TERMINAL_PTR current_terminal;
+
+#define CURRENT_TERMINAL() \
+  (current_terminal ? current_terminal : (abort(), (TERMINAL_PTR) 0))
 
-extern int dont_calculate_costs; /* Nonzero means don't bother computing
-				    various cost tables; we won't use them. */
+#define TERMINAL_MUST_WRITE_SPACES(t) ((t)->must_write_spaces)
+#define TERMINAL_FAST_CLEAR_END_OF_LINE(t) ((t)->fast_clear_end_of_line)
+#define TERMINAL_LINE_INS_DEL_OK(t) ((t)->line_ins_del_ok)
+#define TERMINAL_CHAR_INS_DEL_OK(t) ((t)->char_ins_del_ok)
+#define TERMINAL_SCROLL_REGION_OK(t) ((t)->scroll_region_ok)
+#define TERMINAL_SCROLL_REGION_COST(t) ((t)->scroll_region_cost)
+#define TERMINAL_MEMORY_BELOW_FRAME(t) ((t)->memory_below_frame)
 
-/* Nonzero means no need to redraw the entire frame on resuming
-   a suspended Emacs.  This is useful on terminals with multiple pages,
-   where one page is used for Emacs and another for all else. */
-extern int no_redraw_on_reenter;
+#if 0
+/* These are not used anywhere. */
+#define TERMINAL_MIN_PADDING_SPEED(t) ((t)->min_padding_speed)
+#define TERMINAL_DONT_CALCULATE_COSTS(t) ((t)->dont_calculate_costs)
+#endif
 
 /* arch-tag: bf9f0d49-842b-42fb-9348-ec8759b27193
    (do not change this comment) */
--- a/src/termopts.h	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/termopts.h	Wed Dec 24 18:55:24 2003 +0000
@@ -40,5 +40,10 @@
 /* Nonzero means truncate lines in all windows less wide than the frame */
 extern int truncate_partial_width_windows;
 
+/* Nonzero means no need to redraw the entire frame on resuming a suspended
+   Emacs.  This is useful on terminals with multiple pages, where one page is
+   used for Emacs and another for all else. */
+extern int no_redraw_on_reenter;
+
 /* arch-tag: 35d4d284-dc1a-4fff-97fa-0154a21aebdb
    (do not change this comment) */
--- a/src/w32term.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/w32term.c	Wed Dec 24 18:55:24 2003 +0000
@@ -6366,12 +6366,13 @@
   redeem_scroll_bar_hook = w32_redeem_scroll_bar;
   judge_scroll_bars_hook = w32_judge_scroll_bars;
 
-  scroll_region_ok = 1;         /* we'll scroll partial frames */
-  char_ins_del_ok = 1;
-  line_ins_del_ok = 1;          /* we'll just blt 'em */
-  fast_clear_end_of_line = 1;   /* X does this well */
-  memory_below_frame = 0;       /* we don't remember what scrolls
-				   off the bottom */
+  TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()) = 1; /* we'll scroll partial frames */
+  TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ()) = 1;
+  TERMINAL_LINE_INS_DEL_OK (CURRENT_TERMINAL ()) = 1; /* we'll just blt 'em */
+  TERMINAL_FAST_CLEAR_END_OF_LINE (CURRENT_TERMINAL ()) = 1; /* X does this well */
+  TERMINAL_MEMORY_BELOW_FRAME (CURRENT_TERMINAL ()) = 0; /* we don't remember what
+                                                            scrolls off the
+                                                            bottom */
   baud_rate = 19200;
 
   w32_system_caret_hwnd = NULL;
--- a/src/xdisp.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/xdisp.c	Wed Dec 24 18:55:24 2003 +0000
@@ -12889,7 +12889,7 @@
 
   /* Window must either use window-based redisplay or be full width.  */
   if (!FRAME_WINDOW_P (f)
-      && (!line_ins_del_ok
+      && (!TERMINAL_LINE_INS_DEL_OK (CURRENT_TERMINAL ())
 	  || !WINDOW_FULL_WIDTH_P (w)))
     GIVE_UP (4);
 
@@ -13322,7 +13322,7 @@
 
 	      /* On dumb terminals delete dvpos lines at the end
 		 before inserting dvpos empty lines.  */
-	      if (!scroll_region_ok)
+	      if (!TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()))
 		ins_del_lines (end - dvpos, -dvpos);
 
 	      /* Insert dvpos empty lines in front of
@@ -13343,7 +13343,7 @@
 
 	      /* On a dumb terminal insert dvpos empty lines at the
                  end.  */
-	      if (!scroll_region_ok)
+	      if (!TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()))
 		ins_del_lines (end + dvpos, -dvpos);
 	    }
 
--- a/src/xterm.c	Wed Dec 24 16:09:13 2003 +0000
+++ b/src/xterm.c	Wed Dec 24 18:55:24 2003 +0000
@@ -10852,12 +10852,13 @@
   redeem_scroll_bar_hook = XTredeem_scroll_bar;
   judge_scroll_bars_hook = XTjudge_scroll_bars;
 
-  scroll_region_ok = 1;		/* we'll scroll partial frames */
-  char_ins_del_ok = 1;
-  line_ins_del_ok = 1;		/* we'll just blt 'em */
-  fast_clear_end_of_line = 1;	/* X does this well */
-  memory_below_frame = 0;	/* we don't remember what scrolls
-				   off the bottom */
+  TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()) = 1; /* we'll scroll partial frames */
+  TERMINAL_CHAR_INS_DEL_OK (CURRENT_TERMINAL ()) = 1;
+  TERMINAL_LINE_INS_DEL_OK (CURRENT_TERMINAL ()) = 1; /* we'll just blt 'em */
+  TERMINAL_FAST_CLEAR_END_OF_LINE (CURRENT_TERMINAL ()) = 1; /* X does this well */
+  TERMINAL_MEMORY_BELOW_FRAME (CURRENT_TERMINAL ()) = 0; /* we don't remember what
+                                                         scrolls off the
+                                                         bottom */
   baud_rate = 19200;
 
   x_noop_count = 0;