diff options
author | Masatake YAMATO <yamato@redhat.com> | 2012-07-20 07:32:30 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-07-20 07:32:30 -0400 |
commit | bbf0e7d97893b9abfe6575a408f03e48543cb513 (patch) | |
tree | 4c902d028a64bffea758f2c5e78817a1f853549c /lisp/term | |
parent | c28662a8dc4fefae711b21fcb7a71e871e37d1e6 (diff) | |
download | emacs-bbf0e7d97893b9abfe6575a408f03e48543cb513.tar.gz |
* lisp/term/x-win.el (x-menu-bar-open): Use `frame-parameter'
to check whether menu-bar is shown or not. If not shown,
show the menu-bar as a popup menu instead of using tmm.
* lisp/mouse.el (popup-menu): Accept `point' as `position' argument.
Diffstat (limited to 'lisp/term')
-rw-r--r-- | lisp/term/x-win.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 498cc01fe22..fb7389b856c 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -1305,12 +1305,18 @@ Request data types in the order specified by `x-select-request-type'." (declare-function accelerate-menu "xmenu.c" (&optional frame) t) (defun x-menu-bar-open (&optional frame) - "Open the menu bar if `menu-bar-mode' is on, otherwise call `tmm-menubar'." + "Open the menu bar if it is shown. +`popup-menu' is used if it is off " (interactive "i") - (if (and menu-bar-mode - (fboundp 'accelerate-menu)) - (accelerate-menu frame) - (tmm-menubar))) + (cond + ((and (not (zerop (or (frame-parameter nil 'menu-bar-lines) 0))) + (fboundp 'accelerate-menu)) + (accelerate-menu frame)) + (t + (popup-menu (mouse-menu-bar-map) + (if (listp last-nonmenu-event) + nil + 'point))))) ;;; Window system initialization. |