aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1994-11-09 03:43:30 +0000
committerRoland McGrath1994-11-09 03:43:30 +0000
commit2eb6bfbe932b770b115d6625f7da3a13685dbfdf (patch)
tree3d38953190cdbc4391edb390312b9c78aa85d971
parent3e809b9f194fc4522ab1a83354947f684c0f409d (diff)
downloademacs-2eb6bfbe932b770b115d6625f7da3a13685dbfdf.tar.gz
emacs-2eb6bfbe932b770b115d6625f7da3a13685dbfdf.zip
(EVENT_QUEUES_EMPTY): Only test do_mouse_tracking and mouse_moved #ifdef
HAVE_MOUSE. (Ftrack_mouse): Protect with #ifdef HAVE_MOUSE. (syms_of_keyboard): Protect initialization of do_mouse_tracking, defsubr of Strack_mouse, and DEFVAR of track-mouse with #ifdef HAVE_MOUSE.
-rw-r--r--src/keyboard.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index b6230e1c10e..4de3e805817 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -375,6 +375,7 @@ static volatile struct input_event *kbd_store_ptr;
375 dequeuing functions? Such a flag could be screwed up by interrupts 375 dequeuing functions? Such a flag could be screwed up by interrupts
376 at inopportune times. */ 376 at inopportune times. */
377 377
378#ifdef HAVE_MOUSE
378/* If this flag is a frame, we check mouse_moved to see when the 379/* If this flag is a frame, we check mouse_moved to see when the
379 mouse moves, and motion events will appear in the input stream. 380 mouse moves, and motion events will appear in the input stream.
380 Otherwise, mouse motion is ignored. */ 381 Otherwise, mouse motion is ignored. */
@@ -396,6 +397,9 @@ int mouse_moved;
396 ((kbd_fetch_ptr == kbd_store_ptr) \ 397 ((kbd_fetch_ptr == kbd_store_ptr) \
397 && (! FRAMEP (do_mouse_tracking) || !mouse_moved)) 398 && (! FRAMEP (do_mouse_tracking) || !mouse_moved))
398 399
400#else /* Not HAVE_MOUSE. */
401#define EVENT_QUEUES_EMPTY (kbd_fetch_ptr == kbd_store_ptr)
402#endif /* HAVE_MOUSE. */
399 403
400/* Symbols to head events. */ 404/* Symbols to head events. */
401Lisp_Object Qmouse_movement; 405Lisp_Object Qmouse_movement;
@@ -1935,6 +1939,8 @@ restore_getcjmp (temp)
1935} 1939}
1936 1940
1937 1941
1942#ifdef HAVE_MOUSE
1943
1938/* Restore mouse tracking enablement. See Ftrack_mouse for the only use 1944/* Restore mouse tracking enablement. See Ftrack_mouse for the only use
1939 of this function. */ 1945 of this function. */
1940 1946
@@ -1981,6 +1987,8 @@ Normally, mouse motion is ignored.")
1981 val = Fprogn (args); 1987 val = Fprogn (args);
1982 return unbind_to (count, val); 1988 return unbind_to (count, val);
1983} 1989}
1990
1991#endif /* HAVE_MOUSE */
1984 1992
1985/* Low level keyboard/mouse input. 1993/* Low level keyboard/mouse input.
1986 kbd_buffer_store_event places events in kbd_buffer, and 1994 kbd_buffer_store_event places events in kbd_buffer, and
@@ -2261,6 +2269,7 @@ kbd_buffer_get_event ()
2261 } 2269 }
2262 } 2270 }
2263 } 2271 }
2272#ifdef HAVE_MOUSE
2264 /* Try generating a mouse motion event. */ 2273 /* Try generating a mouse motion event. */
2265 else if (FRAMEP (do_mouse_tracking) && mouse_moved) 2274 else if (FRAMEP (do_mouse_tracking) && mouse_moved)
2266 { 2275 {
@@ -2297,13 +2306,12 @@ kbd_buffer_get_event ()
2297 } 2306 }
2298#endif 2307#endif
2299 2308
2300#if defined (MULTI_FRAME) || defined (HAVE_MOUSE)
2301 /* If we didn't decide to make a switch-frame event, go ahead and 2309 /* If we didn't decide to make a switch-frame event, go ahead and
2302 return a mouse-motion event. */ 2310 return a mouse-motion event. */
2303 if (!NILP (x) && NILP (obj)) 2311 if (!NILP (x) && NILP (obj))
2304 obj = make_lispy_movement (f, bar_window, part, x, y, time); 2312 obj = make_lispy_movement (f, bar_window, part, x, y, time);
2305#endif
2306 } 2313 }
2314#endif /* HAVE_MOUSE */
2307 else 2315 else
2308 /* We were promised by the above while loop that there was 2316 /* We were promised by the above while loop that there was
2309 something for us to read! */ 2317 something for us to read! */
@@ -5959,7 +5967,9 @@ init_keyboard ()
5959 recent_keys_index = 0; 5967 recent_keys_index = 0;
5960 kbd_fetch_ptr = kbd_buffer; 5968 kbd_fetch_ptr = kbd_buffer;
5961 kbd_store_ptr = kbd_buffer; 5969 kbd_store_ptr = kbd_buffer;
5970#ifdef HAVE_MOUSE
5962 do_mouse_tracking = Qnil; 5971 do_mouse_tracking = Qnil;
5972#endif
5963 input_pending = 0; 5973 input_pending = 0;
5964 5974
5965#ifdef MULTI_FRAME 5975#ifdef MULTI_FRAME
@@ -6165,7 +6175,9 @@ syms_of_keyboard ()
6165 6175
6166 defsubr (&Sread_key_sequence); 6176 defsubr (&Sread_key_sequence);
6167 defsubr (&Srecursive_edit); 6177 defsubr (&Srecursive_edit);
6178#ifdef HAVE_MOUSE
6168 defsubr (&Strack_mouse); 6179 defsubr (&Strack_mouse);
6180#endif
6169 defsubr (&Sinput_pending_p); 6181 defsubr (&Sinput_pending_p);
6170 defsubr (&Scommand_execute); 6182 defsubr (&Scommand_execute);
6171 defsubr (&Srecent_keys); 6183 defsubr (&Srecent_keys);
@@ -6383,8 +6395,10 @@ Otherwise, the menu bar continues to reflect the buffer's local map\n\
6383and the minor mode maps regardless of `overriding-local-map'."); 6395and the minor mode maps regardless of `overriding-local-map'.");
6384 Voverriding_local_map_menu_flag = Qnil; 6396 Voverriding_local_map_menu_flag = Qnil;
6385 6397
6398#ifdef HAVE_MOUSE
6386 DEFVAR_BOOL ("track-mouse", &do_mouse_tracking, 6399 DEFVAR_BOOL ("track-mouse", &do_mouse_tracking,
6387 "*Non-nil means generate motion events for mouse motion."); 6400 "*Non-nil means generate motion events for mouse motion.");
6401#endif
6388 6402
6389 DEFVAR_LISP ("system-key-alist", &Vsystem_key_alist, 6403 DEFVAR_LISP ("system-key-alist", &Vsystem_key_alist,
6390 "Alist of system-specific X windows key symbols.\n\ 6404 "Alist of system-specific X windows key symbols.\n\