summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lmenu.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-01-04 23:30:37 +0000
committerRichard M. Stallman <rms@gnu.org>1994-01-04 23:30:37 +0000
commitda161e1860044239b80f851e6acc1d829294f85c (patch)
tree68d7f677521afff75f55666defdd5c22ff4fb6a2 /lisp/emacs-lisp/lmenu.el
parent38d34d662528ed336280bcf6203929fce36776d6 (diff)
downloademacs-da161e1860044239b80f851e6acc1d829294f85c.tar.gz
(popup-menu): Add loop to handle submenus.
Diffstat (limited to 'lisp/emacs-lisp/lmenu.el')
-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 dc108c14b00..3883d0ed4be 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.