comparison src/xterm.c @ 6683:af1629dfdb4c

(note_mouse_highlight): Temporarily widen the buffer. (note_mouse_highlight): Check window still shows buffer that was displayed in it.
author Richard M. Stallman <rms@gnu.org>
date Tue, 05 Apr 1994 07:41:09 +0000
parents cb14d76e993c
children 770fe370479b
comparison
equal deleted inserted replaced
6682:16ab14205588 6683:af1629dfdb4c
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to 17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 /* Serious problems:
21
22 Kludge: dup2 is used to put the X-connection socket into desc # 0
23 so that wait_reading_process_input will wait for it in place of
24 actual terminal input.
25
26 */
27 19
28 /* Xt features made by Fred Pierresteguy. */ 20 /* Xt features made by Fred Pierresteguy. */
29 21
30 #define NEW_SELECTIONS 22 #define NEW_SELECTIONS
31 23
1989 if (! EQ (window, mouse_face_window)) 1981 if (! EQ (window, mouse_face_window))
1990 clear_mouse_face (); 1982 clear_mouse_face ();
1991 1983
1992 /* Are we in a window whose display is up to date? */ 1984 /* Are we in a window whose display is up to date? */
1993 if (WINDOWP (window) && portion == 0 1985 if (WINDOWP (window) && portion == 0
1994 && EQ (w->window_end_valid, Qt)) 1986 && EQ (w->window_end_valid, w->buffer))
1995 { 1987 {
1996 int *ptr = FRAME_CURRENT_GLYPHS (f)->charstarts[row]; 1988 int *ptr = FRAME_CURRENT_GLYPHS (f)->charstarts[row];
1997 int i, pos; 1989 int i, pos;
1998 1990
1999 /* Find which buffer position the mouse corresponds to. */ 1991 /* Find which buffer position the mouse corresponds to. */
2008 { 2000 {
2009 Lisp_Object mouse_face, overlay, position; 2001 Lisp_Object mouse_face, overlay, position;
2010 Lisp_Object *overlay_vec; 2002 Lisp_Object *overlay_vec;
2011 int len, noverlays, ignor1; 2003 int len, noverlays, ignor1;
2012 struct buffer *obuf; 2004 struct buffer *obuf;
2013 2005 int obegv, ozv;
2014 /* If we get an out-of-range value, return now; 2006
2015 don't get an error. */ 2007 /* If we get an out-of-range value, return now; avoid an error. */
2016 if (pos > BUF_ZV (XBUFFER (w->buffer))) 2008 if (pos > BUF_Z (XBUFFER (w->buffer)))
2017 return; 2009 return;
2018 2010
2019 /* Make the window's buffer temporarily current for 2011 /* Make the window's buffer temporarily current for
2020 overlays_at and compute_char_face. */ 2012 overlays_at and compute_char_face. */
2021 obuf = current_buffer; 2013 obuf = current_buffer;
2022 current_buffer = XBUFFER (w->buffer); 2014 current_buffer = XBUFFER (w->buffer);
2015 obegv = BEGV;
2016 ozv = ZV;
2017 BEGV = BEG;
2018 ZV = Z;
2023 2019
2024 /* Yes. Clear the display of the old active region, if any. */ 2020 /* Yes. Clear the display of the old active region, if any. */
2025 clear_mouse_face (); 2021 clear_mouse_face ();
2026 2022
2027 /* Is this char mouse-active? */ 2023 /* Is this char mouse-active? */
2099 &ignore, pos + 1, 1); 2095 &ignore, pos + 1, 1);
2100 2096
2101 /* Display it as active. */ 2097 /* Display it as active. */
2102 show_mouse_face (1); 2098 show_mouse_face (1);
2103 } 2099 }
2100 BEGV = obegv;
2101 ZV = ozv;
2104 current_buffer = obuf; 2102 current_buffer = obuf;
2105 } 2103 }
2106 else if (pos <= 0) 2104 else if (pos <= 0)
2107 clear_mouse_face (); 2105 clear_mouse_face ();
2108 } 2106 }