(U+7F4F): Apply new conventions for glyph granularity.
[chise/xemacs-chise.git.1] / src / redisplay-tty.c
index 80bdcc4..6dc7d63 100644 (file)
@@ -196,7 +196,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
                          int cursor_height)
 {
   struct frame *f = XFRAME (w->frame);
-  Charc_dynarr *buf = Dynarr_new (Charc);
+  Charc_dynarr *buf;
 
   struct display_block *db = Dynarr_atp (dl->display_blocks, block);
   rune_dynarr *rba = db->runes;
@@ -222,7 +222,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
   if (end < 0)
     end = Dynarr_length (rba);
 
-  Dynarr_reset (buf);
+  buf = Dynarr_new (Charc);
 
   while (elt < end && Dynarr_atp (rba, elt)->xpos < start_pixpos)
     {
@@ -344,7 +344,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
                    case IMAGE_TEXT:
                    case IMAGE_POINTER:
                    default:
-                     abort ();
+                     ABORT ();
                    }
                  IMAGE_INSTANCE_OPTIMIZE_OUTPUT
                    (XIMAGE_INSTANCE (instance)) = 0;
@@ -354,7 +354,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
              elt++;
            }
          else
-           abort ();
+           ABORT ();
        }
     }
 
@@ -863,6 +863,9 @@ set_tty_modes (struct console *c)
   OUTPUT1_IF (c, TTY_SD (c).init_motion);
   OUTPUT1_IF (c, TTY_SD (c).cursor_visible);
   OUTPUT1_IF (c, TTY_SD (c).keypad_on);
+
+  if (TTY_FLAGS (c).auto_margins)
+    OUTPUT1_IF (c, TTY_SD (c).disable_auto_margins);
 }
 
 /*****************************************************************************
@@ -881,6 +884,9 @@ reset_tty_modes (struct console *c)
   OUTPUT1_IF (c, TTY_SD (c).cursor_normal);
   OUTPUT1_IF (c, TTY_SD (c).end_motion);
 
+  if (TTY_FLAGS (c).auto_margins)
+    OUTPUT1_IF (c, TTY_SD (c).enable_auto_margins);
+
   {
     Lisp_Object frm = CONSOLE_SELECTED_FRAME (c);
 
@@ -1184,12 +1190,14 @@ init_tty_for_redisplay (struct device *d, char *terminal_type)
       TTY_SD (c).audio_bell = "\07";
     }
 
-  TTY_SD (c).cursor_visible = tgetstr ("ve", &bufptr);
-  TTY_SD (c).cursor_normal = tgetstr ("vs", &bufptr);
+  TTY_SD (c).cursor_visible = tgetstr ("vs", &bufptr);
+  TTY_SD (c).cursor_normal = tgetstr ("ve", &bufptr);
   TTY_SD (c).init_motion = tgetstr ("ti", &bufptr);
   TTY_SD (c).end_motion = tgetstr ("te", &bufptr);
   TTY_SD (c).keypad_on = tgetstr ("ks", &bufptr);
   TTY_SD (c).keypad_off = tgetstr ("ke", &bufptr);
+  TTY_SD (c).disable_auto_margins = tgetstr ("RA", &bufptr);
+  TTY_SD (c).enable_auto_margins = tgetstr ("SA", &bufptr);
 
 
   /*
@@ -1202,6 +1210,7 @@ init_tty_for_redisplay (struct device *d, char *terminal_type)
   TTY_FLAGS (c).memory_below_frame = tgetflag ("db");
   TTY_FLAGS (c).standout_width = tgetnum ("sg");
   TTY_FLAGS (c).underline_width = tgetnum ("ug");
+  TTY_FLAGS (c).auto_margins = tgetflag ("am");
 
   if (TTY_FLAGS (c).standout_width == -1)
     TTY_FLAGS (c).standout_width = 0;