aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-07-14 05:00:21 +0000
committerRichard M. Stallman1994-07-14 05:00:21 +0000
commit68553292534acd78ac3aee18033b7624f22026fc (patch)
treeadf8248486fdafd2e1408912c0bd2655971ff15b /src
parente118d5efd59dc14c9cdc9bdf79665804cdc8842c (diff)
downloademacs-68553292534acd78ac3aee18033b7624f22026fc.tar.gz
emacs-68553292534acd78ac3aee18033b7624f22026fc.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 0acc61cdd5c..442ad273b2f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1263,15 +1263,16 @@ static void
1263safe_run_hooks (hook) 1263safe_run_hooks (hook)
1264 Lisp_Object hook; 1264 Lisp_Object hook;
1265{ 1265{
1266 Lisp_Object value;
1266 int count = specpdl_ptr - specpdl; 1267 int count = specpdl_ptr - specpdl;
1267 specbind (Qinhibit_quit, Qt); 1268 specbind (Qinhibit_quit, Qt);
1268 1269
1269 /* We read and set the variable with functions, 1270 /* We read and set the variable with functions,
1270 in case it's buffer-local. */ 1271 in case it's buffer-local. */
1271 Vcommand_hook_internal = Fsymbol_value (hook); 1272 value = Vcommand_hook_internal = Fsymbol_value (hook);
1272 Fset (hook, Qnil); 1273 Fset (hook, Qnil);
1273 call1 (Vrun_hooks, Qcommand_hook_internal); 1274 call1 (Vrun_hooks, Qcommand_hook_internal);
1274 Fset (hook, Vcommand_hook_internal); 1275 Fset (hook, value);
1275 1276
1276 unbind_to (count, Qnil); 1277 unbind_to (count, Qnil);
1277} 1278}
@@ -2186,7 +2187,9 @@ kbd_buffer_get_event ()
2186 obj = make_lispy_switch_frame (frame); 2187 obj = make_lispy_switch_frame (frame);
2187 internal_last_event_frame = frame; 2188 internal_last_event_frame = frame;
2188 } 2189 }
2190#endif
2189 2191
2192#if defined(MULTI_FRAME) || defined(HAVE_MOUSE)
2190 /* If we didn't decide to make a switch-frame event, go ahead and 2193 /* If we didn't decide to make a switch-frame event, go ahead and
2191 return a mouse-motion event. */ 2194 return a mouse-motion event. */
2192 if (NILP (obj)) 2195 if (NILP (obj))
@@ -2820,7 +2823,7 @@ make_lispy_event (event)
2820 } 2823 }
2821} 2824}
2822 2825
2823#ifdef MULTI_FRAME 2826#if defined(MULTI_FRAME) || defined(HAVE_MOUSE)
2824 2827
2825static Lisp_Object 2828static Lisp_Object
2826make_lispy_movement (frame, bar_window, part, x, y, time) 2829make_lispy_movement (frame, bar_window, part, x, y, time)
@@ -2830,6 +2833,7 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
2830 Lisp_Object x, y; 2833 Lisp_Object x, y;
2831 unsigned long time; 2834 unsigned long time;
2832{ 2835{
2836#ifdef MULTI_FRAME
2833 /* Is it a scroll bar movement? */ 2837 /* Is it a scroll bar movement? */
2834 if (frame && ! NILP (bar_window)) 2838 if (frame && ! NILP (bar_window))
2835 { 2839 {
@@ -2848,13 +2852,18 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
2848 2852
2849 /* Or is it an ordinary mouse movement? */ 2853 /* Or is it an ordinary mouse movement? */
2850 else 2854 else
2855#endif /* MULTI_FRAME */
2851 { 2856 {
2852 int area; 2857 int area;
2853 Lisp_Object window; 2858 Lisp_Object window;
2854 Lisp_Object posn; 2859 Lisp_Object posn;
2855 int column, row; 2860 int column, row;
2856 2861
2862#ifdef MULTI_FRAME
2857 if (frame) 2863 if (frame)
2864#else
2865 if (1)
2866#endif
2858 { 2867 {
2859 /* It's in a frame; which window on that frame? */ 2868 /* It's in a frame; which window on that frame? */
2860 pixel_to_glyph_coords (frame, XINT (x), XINT (y), &column, &row, 0, 1); 2869 pixel_to_glyph_coords (frame, XINT (x), XINT (y), &column, &row, 0, 1);
@@ -2880,11 +2889,13 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
2880 XSET (posn, Lisp_Int, 2889 XSET (posn, Lisp_Int,
2881 buffer_posn_from_coords (XWINDOW (window), column, row)); 2890 buffer_posn_from_coords (XWINDOW (window), column, row));
2882 } 2891 }
2892#ifdef MULTI_FRAME
2883 else if (frame != 0) 2893 else if (frame != 0)
2884 { 2894 {
2885 XSET (window, Lisp_Frame, frame); 2895 XSET (window, Lisp_Frame, frame);
2886 posn = Qnil; 2896 posn = Qnil;
2887 } 2897 }
2898#endif
2888 else 2899 else
2889 { 2900 {
2890 window = Qnil; 2901 window = Qnil;
@@ -2903,7 +2914,7 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
2903 } 2914 }
2904} 2915}
2905 2916
2906#endif /* MULTI_FRAME */ 2917#endif /* neither MULTI_FRAME nor HAVE_MOUSE */
2907 2918
2908/* Construct a switch frame event. */ 2919/* Construct a switch frame event. */
2909static Lisp_Object 2920static Lisp_Object