aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-04-01 10:12:10 +0000
committerRichard M. Stallman1994-04-01 10:12:10 +0000
commit09fe4c319e7de535b15dbc481cdd3362d62eee11 (patch)
tree3964da391ff34ba8ec0503ab72f4abf18d0c51ea
parenta9c90b7c24fa8c69aa40bf60a60b238e48bf4ef0 (diff)
downloademacs-09fe4c319e7de535b15dbc481cdd3362d62eee11.tar.gz
emacs-09fe4c319e7de535b15dbc481cdd3362d62eee11.zip
(construct_menu_click, construct_mouse_click):
Use XSET when setting result->x and result->y. (note_mouse_highlight): Use the value from sort_overlays. Make the window's buffer current temporarily. window_end_pos is relative to Z, not ZV.
-rw-r--r--src/xterm.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 799a3068b6f..738a508fea3 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1832,8 +1832,8 @@ construct_mouse_click (result, event, f)
1832 XFASTINT (result->x) = column; 1832 XFASTINT (result->x) = column;
1833 XFASTINT (result->y) = row; 1833 XFASTINT (result->y) = row;
1834#endif 1834#endif
1835 XFASTINT (result->x) = event->x; 1835 XSET (result->x, Lisp_Int, event->x);
1836 XFASTINT (result->y) = event->y; 1836 XSET (result->y, Lisp_Int, event->y);
1837 XSET (result->frame_or_window, Lisp_Frame, f); 1837 XSET (result->frame_or_window, Lisp_Frame, f);
1838 } 1838 }
1839} 1839}
@@ -1856,8 +1856,8 @@ construct_menu_click (result, event, f)
1856 ? up_modifier 1856 ? up_modifier
1857 : down_modifier)); 1857 : down_modifier));
1858 1858
1859 XFASTINT (result->x) = event->x; 1859 XSET (result->x, Lisp_Int, event->x);
1860 XSETINT (result->y, -1); 1860 XSET (result->y, Lisp_Int, -1);
1861 XSET (result->frame_or_window, Lisp_Frame, f); 1861 XSET (result->frame_or_window, Lisp_Frame, f);
1862} 1862}
1863 1863
@@ -1965,6 +1965,11 @@ note_mouse_highlight (f, x, y)
1965 Lisp_Object *overlay_vec; 1965 Lisp_Object *overlay_vec;
1966 int len, noverlays, ignor1; 1966 int len, noverlays, ignor1;
1967 1967
1968 /* Make the window's buffer temporarily current for
1969 overlays_at and compute_char_face. */
1970 struct buffer *obuf = current_buffer;
1971 current_buffer = XBUFFER (w->buffer);
1972
1968 /* Yes. Clear the display of the old active region, if any. */ 1973 /* Yes. Clear the display of the old active region, if any. */
1969 clear_mouse_face (); 1974 clear_mouse_face ();
1970 1975
@@ -1977,7 +1982,7 @@ note_mouse_highlight (f, x, y)
1977 /* Put all the overlays we want in a vector in overlay_vec. 1982 /* Put all the overlays we want in a vector in overlay_vec.
1978 Store the length in len. */ 1983 Store the length in len. */
1979 noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, &ignor1); 1984 noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, &ignor1);
1980 sort_overlays (overlay_vec, noverlays, w); 1985 noverlays = sort_overlays (overlay_vec, noverlays, w);
1981 1986
1982 /* Find the highest priority overlay that has a mouse-face prop. */ 1987 /* Find the highest priority overlay that has a mouse-face prop. */
1983 overlay = Qnil; 1988 overlay = Qnil;
@@ -2025,7 +2030,7 @@ note_mouse_highlight (f, x, y)
2025 2030
2026 beginning = Fmarker_position (w->start); 2031 beginning = Fmarker_position (w->start);
2027 XSET (end, Lisp_Int, 2032 XSET (end, Lisp_Int,
2028 (BUF_ZV (XBUFFER (w->buffer)) 2033 (BUF_Z (XBUFFER (w->buffer))
2029 - XFASTINT (w->window_end_pos))); 2034 - XFASTINT (w->window_end_pos)));
2030 before 2035 before
2031 = Fprevious_single_property_change (make_number (pos + 1), 2036 = Fprevious_single_property_change (make_number (pos + 1),
@@ -2045,6 +2050,7 @@ note_mouse_highlight (f, x, y)
2045 /* Display it as active. */ 2050 /* Display it as active. */
2046 show_mouse_face (1); 2051 show_mouse_face (1);
2047 } 2052 }
2053 current_buffer = obuf;
2048 } 2054 }
2049 else if (pos <= 0) 2055 else if (pos <= 0)
2050 clear_mouse_face (); 2056 clear_mouse_face ();