changeset 8247:26dbb6234efd

(safe_run_hooks): Use local var to restore hook's value. (kbd_buffer_get_event) [HAVE_MOUSE]: Include code to check for mouse dragging. (make_lispy_movement) [HAVE_MOUSE]: Define also in this case, but only include the non-multiframe stuff.
author Richard M. Stallman <rms@gnu.org>
date Thu, 14 Jul 1994 05:00:21 +0000
parents d48c2b01fba5
children 5ecef3b02f2d
files src/keyboard.c
diffstat 1 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Thu Jul 14 04:58:02 1994 +0000
+++ b/src/keyboard.c	Thu Jul 14 05:00:21 1994 +0000
@@ -1263,15 +1263,16 @@
 safe_run_hooks (hook)
      Lisp_Object hook;
 {
+  Lisp_Object value;
   int count = specpdl_ptr - specpdl;
   specbind (Qinhibit_quit, Qt);
 
   /* We read and set the variable with functions,
      in case it's buffer-local.  */
-  Vcommand_hook_internal = Fsymbol_value (hook);
+  value = Vcommand_hook_internal = Fsymbol_value (hook);
   Fset (hook, Qnil);
   call1 (Vrun_hooks, Qcommand_hook_internal);
-  Fset (hook, Vcommand_hook_internal);
+  Fset (hook, value);
 
   unbind_to (count, Qnil);
 }
@@ -2186,7 +2187,9 @@
 	    obj = make_lispy_switch_frame (frame);
 	  internal_last_event_frame = frame;
 	}
-
+#endif
+
+#if defined(MULTI_FRAME) || defined(HAVE_MOUSE)
       /* If we didn't decide to make a switch-frame event, go ahead and 
 	 return a mouse-motion event.  */
       if (NILP (obj))
@@ -2820,7 +2823,7 @@
     }
 }
 
-#ifdef MULTI_FRAME
+#if defined(MULTI_FRAME) || defined(HAVE_MOUSE)
 
 static Lisp_Object
 make_lispy_movement (frame, bar_window, part, x, y, time)
@@ -2830,6 +2833,7 @@
      Lisp_Object x, y;
      unsigned long time;
 {
+#ifdef MULTI_FRAME
   /* Is it a scroll bar movement?  */
   if (frame && ! NILP (bar_window))
     {
@@ -2848,13 +2852,18 @@
 
   /* Or is it an ordinary mouse movement?  */
   else
+#endif /* MULTI_FRAME */
     {
       int area;
       Lisp_Object window;
       Lisp_Object posn;
       int column, row;
 
+#ifdef MULTI_FRAME
       if (frame)
+#else
+      if (1)
+#endif
 	{
 	  /* It's in a frame; which window on that frame?  */
 	  pixel_to_glyph_coords (frame, XINT (x), XINT (y), &column, &row, 0, 1);
@@ -2880,11 +2889,13 @@
 	    XSET (posn, Lisp_Int,
 		  buffer_posn_from_coords (XWINDOW (window), column, row));
 	}
+#ifdef MULTI_FRAME
       else if (frame != 0)
 	{
 	  XSET (window, Lisp_Frame, frame);
 	  posn = Qnil;
 	}
+#endif
       else
 	{
 	  window = Qnil;
@@ -2903,7 +2914,7 @@
     }
 }
 
-#endif /* MULTI_FRAME */
+#endif /* neither MULTI_FRAME nor HAVE_MOUSE */
 
 /* Construct a switch frame event.  */
 static Lisp_Object