# HG changeset patch # User Richard M. Stallman # Date 765531669 0 # Node ID af1629dfdb4c734f7c571e46ae86ee99eff8779b # Parent 16ab1420558893e4e64113f014c2b63250c1ad45 (note_mouse_highlight): Temporarily widen the buffer. (note_mouse_highlight): Check window still shows buffer that was displayed in it. diff -r 16ab14205588 -r af1629dfdb4c src/xterm.c --- a/src/xterm.c Tue Apr 05 07:39:38 1994 +0000 +++ b/src/xterm.c Tue Apr 05 07:41:09 1994 +0000 @@ -17,14 +17,6 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Serious problems: - - Kludge: dup2 is used to put the X-connection socket into desc # 0 - so that wait_reading_process_input will wait for it in place of - actual terminal input. - -*/ - /* Xt features made by Fred Pierresteguy. */ #define NEW_SELECTIONS @@ -1991,7 +1983,7 @@ /* Are we in a window whose display is up to date? */ if (WINDOWP (window) && portion == 0 - && EQ (w->window_end_valid, Qt)) + && EQ (w->window_end_valid, w->buffer)) { int *ptr = FRAME_CURRENT_GLYPHS (f)->charstarts[row]; int i, pos; @@ -2010,16 +2002,20 @@ Lisp_Object *overlay_vec; int len, noverlays, ignor1; struct buffer *obuf; - - /* If we get an out-of-range value, return now; - don't get an error. */ - if (pos > BUF_ZV (XBUFFER (w->buffer))) + int obegv, ozv; + + /* If we get an out-of-range value, return now; avoid an error. */ + if (pos > BUF_Z (XBUFFER (w->buffer))) return; /* Make the window's buffer temporarily current for overlays_at and compute_char_face. */ obuf = current_buffer; current_buffer = XBUFFER (w->buffer); + obegv = BEGV; + ozv = ZV; + BEGV = BEG; + ZV = Z; /* Yes. Clear the display of the old active region, if any. */ clear_mouse_face (); @@ -2101,6 +2097,8 @@ /* Display it as active. */ show_mouse_face (1); } + BEGV = obegv; + ZV = ozv; current_buffer = obuf; } else if (pos <= 0)