comparison src/keyboard.c @ 2512:2a13ec10bfd7

* 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.
author Jim Blandy <jimb@redhat.com>
date Sat, 10 Apr 1993 08:02:22 +0000
parents c0a13d078f68
children 8bfb4d8d4238
comparison
equal deleted inserted replaced
2511:4fc5338ebb8f 2512:2a13ec10bfd7
352 352
353 353
354 /* Symbols to head events. */ 354 /* Symbols to head events. */
355 Lisp_Object Qmouse_movement; 355 Lisp_Object Qmouse_movement;
356 Lisp_Object Qscroll_bar_movement; 356 Lisp_Object Qscroll_bar_movement;
357
358 Lisp_Object Qswitch_frame; 357 Lisp_Object Qswitch_frame;
359 358
360 /* Symbols to denote kinds of events. */ 359 /* Symbols to denote kinds of events. */
361 Lisp_Object Qfunction_key; 360 Lisp_Object Qfunction_key;
362 Lisp_Object Qmouse_click; 361 Lisp_Object Qmouse_click;
363 /* Lisp_Object Qmouse_movement; - also an event header */ 362 /* Lisp_Object Qmouse_movement; - also an event header */
364 363
365 /* Properties of event headers. */ 364 /* Properties of event headers. */
366 Lisp_Object Qevent_kind; 365 Lisp_Object Qevent_kind;
367 Lisp_Object Qevent_symbol_elements; 366 Lisp_Object Qevent_symbol_elements;
367
368 Lisp_Object Qmenu_enable;
368 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
372 mask of modifiers applied to it. If present, this is used to help 373 mask of modifiers applied to it. If present, this is used to help
943 #ifdef MULTI_FRAME 944 #ifdef MULTI_FRAME
944 for (tem = Vframe_list; CONSP (tem); tem = XCONS (tem)->cdr) 945 for (tem = Vframe_list; CONSP (tem); tem = XCONS (tem)->cdr)
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)))
952 { 962 {
953 struct buffer *prev = current_buffer; 963 struct buffer *prev = current_buffer;
1779 1789
1780 /* These two kinds of events get special handling 1790 /* These two kinds of events get special handling
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
1797 /* If this event is on a different frame, return a switch-frame this 1819 /* If this event is on a different frame, return a switch-frame this
1798 time, and leave the event in the queue for next time. */ 1820 time, and leave the event in the queue for next time. */
2074 2096
2075 /* Build the position as appropriate for this mouse click. */ 2097 /* Build the position as appropriate for this mouse click. */
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);
2083 Lisp_Object posn; 2105 Lisp_Object posn;
2084 2106
4543 Qfunction_key = intern ("function-key"); 4565 Qfunction_key = intern ("function-key");
4544 staticpro (&Qfunction_key); 4566 staticpro (&Qfunction_key);
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");
4551 staticpro (&Qvertical_line); 4576 staticpro (&Qvertical_line);
4552 Qvertical_scroll_bar = intern ("vertical-scroll-bar"); 4577 Qvertical_scroll_bar = intern ("vertical-scroll-bar");