]> code.delx.au - gnu-emacs/blobdiff - src/term.c
(HAVE_X11R6): Definition deleted (previous change undone).
[gnu-emacs] / src / term.c
index 6de8227bd2265bb204e1c4c5e137e2110a714f06..a6fb26a59614062fc2ff9f5eca16ca716852afa4 100644 (file)
@@ -297,6 +297,7 @@ extern char *tgetstr ();
 \f
 
 #ifdef WINDOWSNT
+#ifndef HAVE_NTGUI
 /* We aren't X windows, but we aren't termcap either.  This makes me
    uncertain as to what value to use for frame.output_method.  For
    this file, we'll define FRAME_TERMCAP_P to be zero so that our
@@ -305,6 +306,7 @@ extern char *tgetstr ();
 
 #undef FRAME_TERMCAP_P
 #define FRAME_TERMCAP_P(_f_) 0
+#endif /* not HAVE_NTGUI */
 #endif /* WINDOWSNT */
 
 ring_bell ()
@@ -577,6 +579,11 @@ cursor_to (row, col)
       return;
     }
 
+  /* Detect the case where we are called from reset_sys_modes
+     and the costs have never been calculated.  Do nothing.  */
+  if (chars_wasted == 0)
+    return;
+
   col += chars_wasted[row] & 077;
   if (curY == row && curX == col)
     return;
@@ -670,6 +677,7 @@ clear_end_of_line (first_unused_hpos)
 {
   static GLYPH buf = SPACEGLYPH;
   if (FRAME_TERMCAP_P (selected_frame)
+      && chars_wasted != 0
       && TN_standout_width == 0 && curX == 0 && chars_wasted[curY] != 0)
     write_glyphs (&buf, 1);
   clear_end_of_line_raw (first_unused_hpos);
@@ -695,6 +703,11 @@ clear_end_of_line_raw (first_unused_hpos)
       return;
     }
 
+  /* Detect the case where we are called from reset_sys_modes
+     and the costs have never been calculated.  Do nothing.  */
+  if (chars_wasted == 0)
+    return;
+
   first_unused_hpos += chars_wasted[curY] & 077;
   if (curX >= first_unused_hpos)
     return;
@@ -1685,7 +1698,16 @@ If that is not the actual type of terminal you have, use either the\n\
 DCL command `SET TERMINAL/DEVICE= ...' for DEC-compatible terminals,\n\
 or `define EMACS_TERM \"terminal type\"' for non-DEC terminals.\n",
            terminal_type);
-#else
+#else /* not VMS */
+# ifdef TERMINFO
+    fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
+It lacks the ability to position the cursor.\n\
+If that is not the actual type of terminal you have,\n\
+use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
+`setenv TERM ...') to specify the correct type.  It may be necessary\n\
+to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.\n",
+          terminal_type);
+# else /* TERMCAP */
     fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
 It lacks the ability to position the cursor.\n\
 If that is not the actual type of terminal you have,\n\
@@ -1693,7 +1715,8 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
 `setenv TERM ...') to specify the correct type.  It may be necessary\n\
 to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.\n",
           terminal_type);
-#endif
+# endif /* TERMINFO */
+#endif /*VMS */
   if (FRAME_HEIGHT (selected_frame) <= 0
       || FRAME_WIDTH (selected_frame) <= 0)
     fatal ("The frame size has not been specified.");