tags:

views:

50

answers:

2

I put this in my .emacs file:

(custom-set-variables                                                                          
 '(gud-gdb-command-name "gdb --annotate=1")
 '(large-file-warning-threshold nil)
 '(menu-bar-mode t)
 '(shell-dirtrack-verbose nil))
(custom-set-faces                                                                         
 )
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

Note the (menu-bar-mode t). When I fire up emacs, I have to M-x menu-bar-mode to get a menu bar. I am running GNU Emacs 22.1.1 (mac-apple-darwin, Carbon Version 1.6.0)

+3  A: 

The documentation for the associated function says:

With a numeric argument, if the argument is positive,
turn on menu bars; otherwise, turn off menu bars.

So you could try (menu-bar-mode 1) instead of (menu-bar-mode t)

That said, for me (Emacs 23.2.1), setting this via M-x customize-variable menu-bar-mode results in the same entry in my custom-set-variables as you show there, and it has the desired effect when I restart.

There could be a difference between versions of Emacs, though. Did you type that manually? The recommendation is to only use the customize interface for making changes, as making a mistake might break things. Or possibly one of your other settings is invalid?

(In Emacs 23.2.1 I can't customize a gud-gdb-command-name or shell-dirtrack-verbose variable, for instance. OTOH I would presume it's still possible to customize variables from libraries which are only loaded on demand, so this probably doesn't mean anything.)

You could comment out everything else in your customize-variable if you wanted to check this (but watch out for that final closing parenthesis :)

phils
Confirmed: `C-u 1 M-x menu-bar-mode` -> Menu-Bar mode enabled
leo grrr
I tried everything you suggested (modifying the invocation, commenting out other customizations, etc). I'm using the `customize` interface to edit these things, but none of these suggestions worked. It may be a bug with the specific implementation/platform.
Avry
A: 

I don't think (menu-bar-mode 1) belongs inside of custom-set-variables. Instead, put it outside, just like your call to add-hook:

(custom-set-variables
 '(gud-gdb-command-name "gdb --annotate=1")
 '(large-file-warning-threshold nil)
 '(shell-dirtrack-verbose nil))
(custom-set-faces
 )
(menu-bar-mode 1)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
offby1
I tried this: doesn't work.
Avry
Have you tried invoking emacs with "-Q" (assuming that's even possible on OS X)? That will prevent all startup files from loading; if it makes emacs appear with a menu-bar, then you know that some startup file was -preventing- the menu-bar from appearing. I'd try it myself but don't have access to a Mac.
offby1