[gnu.emacs.bug] Lossage caused by call to set_terminal_modes

weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) (01/17/89)

If Emacs is run in an xterm window (not directly as an X application),
xterm saves the screen contents and cursor position when Emacs starts,
and restores them when it exits or suspends.  But the cursor is
restored incorrectly if (and only if, as far as I can tell) the user
has used ^L to redraw the display at any time in the editing session.
In src/xdisp.c:

DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
  "Clear the screen and output again what is supposed to appear on it.")
  ()
{
  if (screen_height == 0) abort (); /* Some bug zeros some core */
  set_terminal_modes ();
  clear_screen ();
  fflush (stdout);
  clear_screen_records ();
  if (screen_height == 0) abort (); /* Some bug zeros some core */
  windows_or_buffers_changed++;
  /* Mark all windows as INaccurate,
     so that every window will have its redisplay done.  */
  mark_window_display_accurate (XWINDOW (minibuf_window)->prev, 0);
  if (screen_height == 0) abort (); /* Some bug zeros some core */
  return Qnil;
}

The call to set_terminal_modes is overwriting the cursor position that
was saved when Emacs was entered, with the cursor position at the time
the display is redrawn.  Is this call of set_terminal_modes() actually
necessary here?
-- 
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University