[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Build error around new function `Fmenu_or_popup_active_p'
From: |
martin rudalics |
Subject: |
Re: Build error around new function `Fmenu_or_popup_active_p' |
Date: |
Mon, 06 Nov 2006 15:49:24 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> The defun part is in condition HAVE_MENU but registration part in
> syms_of_xmenu() is out of HAVE_MENU condition.
> It cause compilation error on non-X-Window environment.
Thank you very much for spotting this. To my dismay this bug also
permeates the corresponding sections in macmenu.c and w32menu.c.
My problem is that `menu-or-popup-active-p' should return nil even in
the case where you build without menus. Hence I propose the attached
patch. Please try whether it works on your system.
Thanks again
martin rudalics.
*** macmenu.c Mon Nov 6 10:23:06 2006
--- macmenu.c Mon Nov 6 15:18:42 2006
***************
*** 1052,1068 ****
UNBLOCK_INPUT;
}
- /* The following is used by delayed window autoselection. */
-
- DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p,
Smenu_or_popup_active_p, 0, 0, 0,
- doc: /* Return t if a menu or popup dialog is active. */)
- ()
- {
- /* Always return Qnil since menu selection functions do not return
- until a selection has been made or cancelled. */
- return Qnil;
- }
-
/* Find the menu selection and store it in the keyboard buffer.
F is the frame the menu is on.
MENU_BAR_ITEMS_USED is the length of VECTOR.
--- 1052,1057 ----
***************
*** 2653,2658 ****
--- 2642,2658 ----
}
#endif /* HAVE_MENUS */
+
+ /* The following is used by delayed window autoselection. */
+
+ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p,
Smenu_or_popup_active_p, 0, 0, 0,
+ doc: /* Return t if a menu or popup dialog is active. */)
+ ()
+ {
+ /* Always return Qnil since menu selection functions do not return
+ until a selection has been made or cancelled. */
+ return Qnil;
+ }
void
syms_of_macmenu ()
*** w32menu.c Mon Nov 6 10:23:06 2006
--- w32menu.c Mon Nov 6 15:23:12 2006
***************
*** 990,1006 ****
complete_deferred_msg (FRAME_W32_WINDOW (f), WM_INITMENU, 0);
}
- /* The following is used by delayed window autoselection. */
-
- DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p,
Smenu_or_popup_active_p, 0, 0, 0,
- doc: /* Return t if a menu or popup dialog is active on selected
frame. */)
- ()
- {
- FRAME_PTR f;
- f = SELECTED_FRAME ();
- return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
- }
-
/* This callback is called from the menu bar pulldown menu
when the user makes a selection.
Figure out what the user chose
--- 990,995 ----
***************
*** 2536,2541 ****
--- 2525,2545 ----
#endif /* HAVE_MENUS */
+ /* The following is used by delayed window autoselection. */
+
+ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p,
Smenu_or_popup_active_p, 0, 0, 0,
+ doc: /* Return t if a menu or popup dialog is active on selected
frame. */)
+ ()
+ {
+ #ifdef HAVE_MENUS
+ FRAME_PTR f;
+ f = SELECTED_FRAME ();
+ return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
+ #else
+ return Qnil;
+ #endif /* HAVE_MENUS */
+ }
+
void syms_of_w32menu ()
{
globals_of_w32menu ();
*** xmenu.c Mon Nov 6 10:23:06 2006
--- xmenu.c Mon Nov 6 15:17:38 2006
***************
*** 1414,1420 ****
gtk_menu_shell_select_item (GTK_MENU_SHELL (menubar),
GTK_WIDGET (children->data));
!
popup_activated_flag = 1;
g_list_free (children);
}
--- 1414,1420 ----
gtk_menu_shell_select_item (GTK_MENU_SHELL (menubar),
GTK_WIDGET (children->data));
!
popup_activated_flag = 1;
g_list_free (children);
}
***************
*** 1496,1510 ****
return popup_activated_flag;
}
- /* The following is used by delayed window autoselection. */
-
- DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p,
Smenu_or_popup_active_p, 0, 0, 0,
- doc: /* Return t if a menu or popup dialog is active. */)
- ()
- {
- return (popup_activated ()) ? Qt : Qnil;
- }
-
/* This callback is invoked when the user selects a menubar cascade
pushbutton, but before the pulldown menu is posted. */
--- 1496,1501 ----
***************
*** 3770,3775 ****
--- 3761,3780 ----
#endif /* not USE_X_TOOLKIT */
#endif /* HAVE_MENUS */
+
+
+ /* The following is used by delayed window autoselection. */
+
+ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p,
Smenu_or_popup_active_p, 0, 0, 0,
+ doc: /* Return t if a menu or popup dialog is active. */)
+ ()
+ {
+ #ifdef HAVE_MENUS
+ return (popup_activated ()) ? Qt : Qnil;
+ #else
+ return Qnil;
+ #endif /* HAVE_MENUS */
+ }
void
syms_of_xmenu ()