Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!GANG-OF-FOUR.STANFORD.EDU!weening From: weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) Newsgroups: gnu.emacs.bug Subject: Lossage caused by call to set_terminal_modes Message-ID: <8901162237.AA09979@Gang-of-Four.Stanford.EDU> Date: 16 Jan 89 22:37:11 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32 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