aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1993-04-10 08:02:22 +0000
committerJim Blandy1993-04-10 08:02:22 +0000
commit598a9fa7043edbbff46c51db64ab3550bd0b9ca3 (patch)
treef7c8e64610510c4c3bafa61757a21150f7b8ff59 /src
parent5de9f849e8f24802a873fcb16785558aca28a3e3 (diff)
downloademacs-598a9fa7043edbbff46c51db64ab3550bd0b9ca3.tar.gz
emacs-598a9fa7043edbbff46c51db64ab3550bd0b9ca3.zip
* keyboard.c (command_loop_1): Rebuild menu bar if
update_mode_lines is set. Since Qmenu_enable is used by non-X-specific code, it shouldn't be defined in an X-only source file. * xmenu.c (Qmenu_enable): Definition moved... (syms_of_xmenu): ... along with initialization ... * keyboard.c (Qmenu_enable): ... to here ... (syms_of_keyboard): ... and here. * keyboard.c (kbd_buffer_get_event): If we get a selection clear or selection request event, but we were compiled without the window-system-specific code to handle it, abort. Don't try to call a function which doesn't exist. * keyboard.c (make_lispy_event): In the code which processes mouse clicks, declare f to be a FRAME_PTR, not a struct frame *; this works when MULTI_FRAME is not #defined.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index aa8a5e05467..d72125cc98e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -354,7 +354,6 @@ int mouse_moved;
354/* Symbols to head events. */ 354/* Symbols to head events. */
355Lisp_Object Qmouse_movement; 355Lisp_Object Qmouse_movement;
356Lisp_Object Qscroll_bar_movement; 356Lisp_Object Qscroll_bar_movement;
357
358Lisp_Object Qswitch_frame; 357Lisp_Object Qswitch_frame;
359 358
360/* Symbols to denote kinds of events. */ 359/* Symbols to denote kinds of events. */
@@ -366,6 +365,8 @@ Lisp_Object Qmouse_click;
366Lisp_Object Qevent_kind; 365Lisp_Object Qevent_kind;
367Lisp_Object Qevent_symbol_elements; 366Lisp_Object Qevent_symbol_elements;
368 367
368Lisp_Object Qmenu_enable;
369
369/* An event header symbol HEAD may have a property named 370/* An event header symbol HEAD may have a property named
370 Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS); 371 Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS);
371 BASE is the base, unmodified version of HEAD, and MODIFIERS is the 372 BASE is the base, unmodified version of HEAD, and MODIFIERS is the
@@ -945,7 +946,16 @@ command_loop_1 ()
945 { 946 {
946 struct frame *f = XFRAME (XCONS (tem)->car); 947 struct frame *f = XFRAME (XCONS (tem)->car);
947 struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f)); 948 struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
949
950 /* If the user has switched buffers or windows, we need to
951 recompute to reflect the new bindings. But we'll
952 recompute when update_mode_lines is set too; that means
953 that people can use force-mode-line-update to request
954 that the menu bar be recomputed. The adverse effect on
955 the rest of the redisplay algorithm is about the same as
956 windows_or_buffers_changed anyway. */
948 if (windows_or_buffers_changed 957 if (windows_or_buffers_changed
958 || update_mode_lines
949 || (XFASTINT (w->last_modified) < MODIFF 959 || (XFASTINT (w->last_modified) < MODIFF
950 && (XFASTINT (w->last_modified) 960 && (XFASTINT (w->last_modified)
951 <= XBUFFER (w->buffer)->save_modified))) 961 <= XBUFFER (w->buffer)->save_modified)))
@@ -1781,16 +1791,28 @@ kbd_buffer_get_event ()
1781 and don't actually appear to the command loop. */ 1791 and don't actually appear to the command loop. */
1782 if (event->kind == selection_request_event) 1792 if (event->kind == selection_request_event)
1783 { 1793 {
1794#ifdef HAVE_X11
1784 x_handle_selection_request (event); 1795 x_handle_selection_request (event);
1785 kbd_fetch_ptr = event + 1; 1796 kbd_fetch_ptr = event + 1;
1786 goto retry; 1797 goto retry;
1798#else
1799 /* We're getting selection request events, but we don't have
1800 a window system. */
1801 abort ();
1802#endif
1787 } 1803 }
1788 1804
1789 if (event->kind == selection_clear_event) 1805 if (event->kind == selection_clear_event)
1790 { 1806 {
1807#ifdef HAVE_X11
1791 x_handle_selection_clear (event); 1808 x_handle_selection_clear (event);
1792 kbd_fetch_ptr = event + 1; 1809 kbd_fetch_ptr = event + 1;
1793 goto retry; 1810 goto retry;
1811#else
1812 /* We're getting selection request events, but we don't have
1813 a window system. */
1814 abort ();
1815#endif
1794 } 1816 }
1795 1817
1796#ifdef MULTI_FRAME 1818#ifdef MULTI_FRAME
@@ -2076,7 +2098,7 @@ make_lispy_event (event)
2076 if (event->kind == mouse_click) 2098 if (event->kind == mouse_click)
2077 { 2099 {
2078 int part; 2100 int part;
2079 struct frame *f = XFRAME (event->frame_or_window); 2101 FRAME_PTR f = XFRAME (event->frame_or_window);
2080 Lisp_Object window 2102 Lisp_Object window
2081 = window_from_coordinates (f, XINT (event->x), XINT (event->y), 2103 = window_from_coordinates (f, XINT (event->x), XINT (event->y),
2082 &part); 2104 &part);
@@ -4545,6 +4567,9 @@ syms_of_keyboard ()
4545 Qmouse_click = intern ("mouse-click"); 4567 Qmouse_click = intern ("mouse-click");
4546 staticpro (&Qmouse_click); 4568 staticpro (&Qmouse_click);
4547 4569
4570 Qmenu_enable = intern ("menu-enable");
4571 staticpro (&Qmenu_enable);
4572
4548 Qmode_line = intern ("mode-line"); 4573 Qmode_line = intern ("mode-line");
4549 staticpro (&Qmode_line); 4574 staticpro (&Qmode_line);
4550 Qvertical_line = intern ("vertical-line"); 4575 Qvertical_line = intern ("vertical-line");