aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emacs-lisp/easymenu.el23
2 files changed, 12 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 40dcc23d92f..5708a462add 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12008-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/easymenu.el (easy-menu-add): Don't precompute keybindings
4 since those precomputed values aren't used any more.
5 (easy-menu-precalculate-equivalent-keybindings): Obsolete.
6
12008-08-14 Martin Rudalics <rudalics@gmx.at> 72008-08-14 Martin Rudalics <rudalics@gmx.at>
2 8
3 * help.el (with-help-window): Return last value in BODY. 9 * help.el (with-help-window): Return last value in BODY.
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index bdca92e7fb0..123f429ddbf 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -29,16 +29,15 @@
29 29
30;;; Code: 30;;; Code:
31 31
32(defcustom easy-menu-precalculate-equivalent-keybindings t 32(defvar easy-menu-precalculate-equivalent-keybindings nil
33 "Determine when equivalent key bindings are computed for easy-menu menus. 33 "Determine when equivalent key bindings are computed for easy-menu menus.
34It can take some time to calculate the equivalent key bindings that are shown 34It can take some time to calculate the equivalent key bindings that are shown
35in a menu. If the variable is on, then this calculation gives a (maybe 35in a menu. If the variable is on, then this calculation gives a (maybe
36noticeable) delay when a mode is first entered. If the variable is off, then 36noticeable) delay when a mode is first entered. If the variable is off, then
37this delay will come when a menu is displayed the first time. If you never use 37this delay will come when a menu is displayed the first time. If you never use
38menus, turn this variable off, otherwise it is probably better to keep it on." 38menus, turn this variable off, otherwise it is probably better to keep it on.")
39 :type 'boolean 39(make-obsolete-variable
40 :group 'menu 40 'easy-menu-precalculate-equivalent-keybindings nil "23.1")
41 :version "20.3")
42 41
43(defsubst easy-menu-intern (s) 42(defsubst easy-menu-intern (s)
44 (if (stringp s) (intern s) s)) 43 (if (stringp s) (intern s) s))
@@ -499,9 +498,7 @@ To implement dynamic menus, either call this from
499 498
500;; XEmacs needs the following two functions to add and remove menus. 499;; XEmacs needs the following two functions to add and remove menus.
501;; In Emacs this is done automatically when switching keymaps, so 500;; In Emacs this is done automatically when switching keymaps, so
502;; here easy-menu-remove is a noop and easy-menu-add only precalculates 501;; here easy-menu-remove is a noop.
503;; equivalent keybindings (if easy-menu-precalculate-equivalent-keybindings
504;; is on).
505(defalias 'easy-menu-remove 'ignore 502(defalias 'easy-menu-remove 'ignore
506 "Remove MENU from the current menu bar. 503 "Remove MENU from the current menu bar.
507Contrary to XEmacs, this is a nop on Emacs since menus are automatically 504Contrary to XEmacs, this is a nop on Emacs since menus are automatically
@@ -515,17 +512,9 @@ On Emacs, menus are already automatically activated when the
515corresponding keymap is activated. On XEmacs this is needed to 512corresponding keymap is activated. On XEmacs this is needed to
516actually add the menu to the current menubar. 513actually add the menu to the current menubar.
517 514
518This also precalculates equivalent key bindings when
519`easy-menu-precalculate-equivalent-keybindings' is on.
520
521You should call this once the menu and keybindings are set up 515You should call this once the menu and keybindings are set up
522completely and menu filter functions can be expected to work." 516completely and menu filter functions can be expected to work."
523 (when easy-menu-precalculate-equivalent-keybindings 517 )
524 (if (and (symbolp menu) (not (keymapp menu)) (boundp menu))
525 (setq menu (symbol-value menu)))
526 (and (keymapp menu) (fboundp 'x-popup-menu)
527 (x-popup-menu nil menu))
528 ))
529 518
530(defun add-submenu (menu-path submenu &optional before in-menu) 519(defun add-submenu (menu-path submenu &optional before in-menu)
531 "Add submenu SUBMENU in the menu at MENU-PATH. 520 "Add submenu SUBMENU in the menu at MENU-PATH.