Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Using Gnu Emacs 23.1.1 on Ubuntu 10.04...

I'm currently a total newb with emacs, and I've decided to go cold turkey with the Gnome menu bar. (but I do want it to be "available" for the teething transition period... tepid turkey? :)

So I'd like to know how to assign a key to toggle it on/off..

I'm currently starting Emacs in full screen mode, with no menu-bar and no tool-bar I'm trying out a tabbar (when in X, but not when in terminal) ..

I'm almost getting used to it, but I find I feel completely lost sometimes without the menubar... I've read that Emacs without the GUI paraphenalia is the way to go.. and I believe it!... the paradigms clash..

But for now I'd like a menu-bar toggle, and it will be good experience to see how it is done..

share|improve this question

1 Answer 1

up vote 5 down vote accepted

If you just want to toggle the menu bar, there's already a command for that (M-x menu-bar-mode). To bind it to a key, you'd do:

(global-set-key (kbd "<f5>") 'menu-bar-mode)

If you want both the menu and toolbar to be toggled, you can do something like this:

(defun toggle-menu-toolbar-modes ()
  (interactive)
  (tool-bar-mode (menu-bar-mode)))
(global-set-key (kbd "<f5>") 'toggle-menu-toolbar-modes)

It's probably worth looking at the Emacs FAQ (also found by C-h C-f). Also, the SO info page for Emacs has a bunch of good links.

share|improve this answer
1  
Thanks.. nice links too... It works. I tried it 3 times and I've already outgrown it... I discoverd the f10 key which presents the exact same menu in an emacs-style... I'm starting to understand emac's reputation; it's seems to have pretty well everything covered :) –  Peter.O Feb 12 '11 at 20:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.