* menu-bar-map
@ 2008-04-21 22:42 Nick Roberts
2008-04-23 5:18 ` menu-bar-map Chong Yidong
2008-04-23 15:23 ` menu-bar-map Stefan Monnier
0 siblings, 2 replies; 3+ messages in thread
From: Nick Roberts @ 2008-04-21 22:42 UTC (permalink / raw)
To: emacs-devel
Is it possible to create a variable, menu-bar-map say, that overrides the
the global menu bar just like tool-bar-map does for the tool bar?
I'm thinking that it might be useful for small windows, e.g., to display
watch expressions in a debug session, where the global menu bar would
use all the visible area.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: menu-bar-map
2008-04-21 22:42 menu-bar-map Nick Roberts
@ 2008-04-23 5:18 ` Chong Yidong
2008-04-23 15:23 ` menu-bar-map Stefan Monnier
1 sibling, 0 replies; 3+ messages in thread
From: Chong Yidong @ 2008-04-23 5:18 UTC (permalink / raw)
To: Nick Roberts; +Cc: emacs-devel
Nick Roberts <nickrob@snap.net.nz> writes:
> Is it possible to create a variable, menu-bar-map say, that overrides
> the global menu bar just like tool-bar-map does for the tool bar?
>
> I'm thinking that it might be useful for small windows, e.g., to
> display watch expressions in a debug session, where the global menu
> bar would use all the visible area.
Sounds reasonable. Patch welcome.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: menu-bar-map
2008-04-21 22:42 menu-bar-map Nick Roberts
2008-04-23 5:18 ` menu-bar-map Chong Yidong
@ 2008-04-23 15:23 ` Stefan Monnier
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2008-04-23 15:23 UTC (permalink / raw)
To: Nick Roberts; +Cc: emacs-devel
> Is it possible to create a variable, menu-bar-map say, that overrides the
> the global menu bar just like tool-bar-map does for the tool bar?
The following "should work" (it doesn't):
(defvar hide-menu-bar-map
(let ((map (make-sparse-keymap)))
(define-key map [menu-bar] 'undefined)
map))
(defvar my-special-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map hide-menu-bar-map)
(define-key [menu-bar] (make-sparse-keymap))
(define-key [menu-bar foo] '(menu-item "Foo" foo-menu))
map))
If my-special-mode-map is passed to use-local-map, it should hide all
the bindings in [menu-bar] from the global-map. IIUC this will work in
the sense that those global menu entries will indeed not work, tho
they'll still be displayed (yup: a bug).
Note that it will not hide or break the higher-precedence menus, such as
the ones coming from minor-modes.
> I'm thinking that it might be useful for small windows, e.g., to display
> watch expressions in a debug session, where the global menu bar would
> use all the visible area.
I'm not sure what you mean. Since the menu-bar is per-frame I assume
that by "window" you mean "frame", in which case you can just hide the
menu-bar via frame-parameters.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-23 15:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-21 22:42 menu-bar-map Nick Roberts
2008-04-23 5:18 ` menu-bar-map Chong Yidong
2008-04-23 15:23 ` menu-bar-map Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.