changeset 6626:59c44532d2a0

(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.
author Richard M. Stallman <rms@gnu.org>
date Fri, 01 Apr 1994 10:12:10 +0000
parents d53ff9fcf05a
children f8471ecf787b
files src/xterm.c
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Fri Apr 01 10:10:45 1994 +0000
+++ b/src/xterm.c	Fri Apr 01 10:12:10 1994 +0000
@@ -1832,8 +1832,8 @@
     XFASTINT (result->x) = column;
     XFASTINT (result->y) = row;
 #endif
-    XFASTINT (result->x) = event->x;
-    XFASTINT (result->y) = event->y;
+    XSET (result->x, Lisp_Int, event->x);
+    XSET (result->y, Lisp_Int, event->y);
     XSET (result->frame_or_window, Lisp_Frame, f);
   }
 }
@@ -1856,8 +1856,8 @@
 			  ? up_modifier 
 			  : down_modifier));
 
-  XFASTINT (result->x) = event->x;
-  XSETINT (result->y, -1);
+  XSET (result->x, Lisp_Int, event->x);
+  XSET (result->y, Lisp_Int, -1);
   XSET (result->frame_or_window, Lisp_Frame, f);
 }
 
@@ -1965,6 +1965,11 @@
 	  Lisp_Object *overlay_vec;
 	  int len, noverlays, ignor1;
 
+	  /* Make the window's buffer temporarily current for
+	     overlays_at and compute_char_face.  */
+	  struct buffer *obuf = current_buffer;
+	  current_buffer = XBUFFER (w->buffer);
+
 	  /* Yes.  Clear the display of the old active region, if any.  */
 	  clear_mouse_face ();
 
@@ -1977,7 +1982,7 @@
 	  /* Put all the overlays we want in a vector in overlay_vec.
 	     Store the length in len.  */
 	  noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, &ignor1);
-	  sort_overlays (overlay_vec, noverlays, w);
+	  noverlays = sort_overlays (overlay_vec, noverlays, w);
 
 	  /* Find the highest priority overlay that has a mouse-face prop.  */
 	  overlay = Qnil;
@@ -2025,7 +2030,7 @@
 
 	      beginning = Fmarker_position (w->start);
 	      XSET (end, Lisp_Int,
-		    (BUF_ZV (XBUFFER (w->buffer))
+		    (BUF_Z (XBUFFER (w->buffer))
 		     - XFASTINT (w->window_end_pos)));
 	      before
 		= Fprevious_single_property_change (make_number (pos + 1),
@@ -2045,6 +2050,7 @@
 	      /* Display it as active.  */
 	      show_mouse_face (1);
 	    }
+	  current_buffer = obuf;
 	}
       else if (pos <= 0)
 	clear_mouse_face ();