aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1994-01-04 23:30:37 +0000
committerRichard M. Stallman <[email protected]>1994-01-04 23:30:37 +0000
commitd06752db2d8f4f15250624031574f7719a0b3df8 (patch)
tree9af70dc1fe8c920700264c37a837dab45fbc03e5
parent0b312d08319768b63c045b8a36013d7ac66aa090 (diff)
(popup-menu): Add loop to handle submenus.
-rw-r--r--lisp/emacs-lisp/lmenu.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/lmenu.el b/lisp/emacs-lisp/lmenu.el
index dc108c14b0..3883d0ed4b 100644
--- a/lisp/emacs-lisp/lmenu.el
+++ b/lisp/emacs-lisp/lmenu.el
@@ -132,11 +132,16 @@ The syntax, more precisely:
(let ((menu (make-lucid-menu-keymap (car menu-desc) (cdr menu-desc)))
(pos (mouse-position))
answer)
- (setq answer (x-popup-menu (list (list (nth 1 pos) (nthcdr 2 pos))
- (car pos))
- menu))
- (setq cmd (lookup-key menu (vector answer)))
- (if cmd (call-interactively cmd))))
+ (while menu
+ (setq answer (x-popup-menu (list (list (nth 1 pos) (nthcdr 2 pos))
+ (car pos))
+ menu))
+ (setq cmd (lookup-key menu (vector answer)))
+ (setq menu nil)
+ (and cmd
+ (if (keymapp cmd)
+ (setq menu cmd)
+ (call-interactively cmd))))))
;; This is empty because the usual elements of the menu bar
;; are provided by menu-bar.el instead.