aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-02-11 13:50:29 +0000
committerEli Zaretskii2006-02-11 13:50:29 +0000
commit9d56e0da1fe2128b9c7ffdf05f5f7b9ad2ece9fc (patch)
treec27d1dfb8c58f9f42e2b9016578368b817193fac
parent0810857709185b72e00ec1699aff749789239db9 (diff)
downloademacs-9d56e0da1fe2128b9c7ffdf05f5f7b9ad2ece9fc.tar.gz
emacs-9d56e0da1fe2128b9c7ffdf05f5f7b9ad2ece9fc.zip
(Venable_disabled_menus_and_buttons): New variable.
(syms_of_keyboard): DEVFAR_LISP and initialize it. (parse_tool_bar_item, parse_menu_item): If that variable is non-nil, don't disable menu items and tool-bar buttons.
-rw-r--r--src/keyboard.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index d5c5f184cfa..a1b8ad34b07 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -649,6 +649,11 @@ static EMACS_TIME timer_idleness_start_time;
649 649
650static EMACS_TIME timer_last_idleness_start_time; 650static EMACS_TIME timer_last_idleness_start_time;
651 651
652/* If non-nil, events produced by disabled menu items and tool-bar
653 buttons are not ignored. Help functions bind this to allow help on
654 those items and buttons. */
655Lisp_Object Venable_disabled_menus_and_buttons;
656
652 657
653/* Global variable declarations. */ 658/* Global variable declarations. */
654 659
@@ -7271,7 +7276,9 @@ parse_menu_item (item, notreal, inmenubar)
7271 if (SYMBOLP (item)) 7276 if (SYMBOLP (item))
7272 { 7277 {
7273 tem = Fget (item, Qmenu_enable); 7278 tem = Fget (item, Qmenu_enable);
7274 if (!NILP (tem)) 7279 if (!NILP (Venable_disabled_menus_and_buttons))
7280 AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt;
7281 else if (!NILP (tem))
7275 AREF (item_properties, ITEM_PROPERTY_ENABLE) = tem; 7282 AREF (item_properties, ITEM_PROPERTY_ENABLE) = tem;
7276 } 7283 }
7277 } 7284 }
@@ -7300,7 +7307,12 @@ parse_menu_item (item, notreal, inmenubar)
7300 item = XCDR (item); 7307 item = XCDR (item);
7301 7308
7302 if (EQ (tem, QCenable)) 7309 if (EQ (tem, QCenable))
7303 AREF (item_properties, ITEM_PROPERTY_ENABLE) = XCAR (item); 7310 {
7311 if (!NILP (Venable_disabled_menus_and_buttons))
7312 AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt;
7313 else
7314 AREF (item_properties, ITEM_PROPERTY_ENABLE) = XCAR (item);
7315 }
7304 else if (EQ (tem, QCvisible) && !notreal) 7316 else if (EQ (tem, QCvisible) && !notreal)
7305 { 7317 {
7306 /* If got a visible property and that evaluates to nil 7318 /* If got a visible property and that evaluates to nil
@@ -7820,8 +7832,13 @@ parse_tool_bar_item (key, item)
7820 value = XCAR (XCDR (item)); 7832 value = XCAR (XCDR (item));
7821 7833
7822 if (EQ (key, QCenable)) 7834 if (EQ (key, QCenable))
7823 /* `:enable FORM'. */ 7835 {
7824 PROP (TOOL_BAR_ITEM_ENABLED_P) = value; 7836 /* `:enable FORM'. */
7837 if (!NILP (Venable_disabled_menus_and_buttons))
7838 PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt;
7839 else
7840 PROP (TOOL_BAR_ITEM_ENABLED_P) = value;
7841 }
7825 else if (EQ (key, QCvisible)) 7842 else if (EQ (key, QCvisible))
7826 { 7843 {
7827 /* `:visible FORM'. If got a visible property and that 7844 /* `:visible FORM'. If got a visible property and that
@@ -11471,6 +11488,14 @@ If the value is not a number, such messages don't time out. */);
11471The value of that variable is passed to `quit-flag' and later causes a 11488The value of that variable is passed to `quit-flag' and later causes a
11472peculiar kind of quitting. */); 11489peculiar kind of quitting. */);
11473 Vthrow_on_input = Qnil; 11490 Vthrow_on_input = Qnil;
11491
11492 DEFVAR_LISP ("enable-disabled-menus-and-buttons",
11493 &Venable_disabled_menus_and_buttons,
11494 doc: /* If non-nil, don't ignore events produced by disabled menu items and tool-bar.
11495
11496Help functions bind this to allow help on disabled menu items
11497and tool-bar buttons. */);
11498 Venable_disabled_menus_and_buttons = Qnil;
11474} 11499}
11475 11500
11476void 11501void