From: Richard M. Stallman Date: Tue, 10 Dec 1996 23:25:14 +0000 (+0000) Subject: (Vmenu_updating_frame): New variable. X-Git-Tag: emacs-20.1~3288 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bfc524bcad6f0523e61254a91e76bcedf3a65d11;p=emacs.git (Vmenu_updating_frame): New variable. (syms_of_xmenu): Set up Lisp var. (Fx_popup_menu, set_frame_menubar): Initialize it. --- diff --git a/src/xmenu.c b/src/xmenu.c index cec9aa0d004..46b75cc1dbb 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -86,6 +86,8 @@ Boston, MA 02111-1307, USA. */ #define FALSE 0 #endif /* no TRUE */ +Lisp_Object Vmenu_updating_frame; + Lisp_Object Qdebug_on_next_call; Lisp_Object Qmenu_alias; @@ -856,7 +858,10 @@ cached information about equivalent key sequences.") xpos += XINT (x); ypos += XINT (y); + + XSETFRAME (Vmenu_updating_frame, f); } + Vmenu_updating_frame = Qnil; #endif /* HAVE_MENUS */ title = Qnil; @@ -1618,6 +1623,8 @@ set_frame_menubar (f, first_time, deep_p) int i; LWLIB_ID id; + XSETFRAME (Vmenu_updating_frame, f); + if (f->output_data.x->id == 0) f->output_data.x->id = next_menubar_widget_id++; id = f->output_data.x->id; @@ -2708,6 +2715,11 @@ syms_of_xmenu () Qdebug_on_next_call = intern ("debug-on-next-call"); staticpro (&Qdebug_on_next_call); + DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame, + "Frame for which we are updating a menu.\n\ +The enable predicate for a menu command should check this variable."); + Vmenu_updating_frame = Qnil; + #ifdef USE_X_TOOLKIT widget_id_tick = (1<<16); next_menubar_widget_id = 1;