Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: menu-bar-mode and tool-bar-mode automatically set to t

I have compiled and built Emacs24 on my system. After that, some of my .emacs customizations have stopped working.

The most important problem is this: I have set menu-bar-mode and tool-bar-mode to nil.

;;; No Menu Bar
(menu-bar-mode nil)
;;; No tool bar
(tool-bar-mode nil)

;;; No Scrollbar
(scroll-bar-mode nil)

But if I start Emacs, they are always set to t.

Even worse: if I set it to nil using mini-buffer, and then go to scratch and type menu-bar-mode and evaluate the expression, it always changes it to t.

Any ideas why this might be the problem, and how can I fix it?

like image 368
user916315 Avatar asked Feb 24 '12 01:02

user916315


People also ask

How do I access the Emacs menu bar?

Have you ever been wondering how to access the Emacs menu bar, when using Emacs in console mode? The answer is easy - press F10 or type M-x menu-bar-open(both methods work in X as well, of course).

How do I get rid of the scroll bar in Emacs?

You can enable or disable Scroll Bar mode with the command M-x scroll-bar-mode . With no argument, it toggles the use of scroll bars. With an argument, it turns use of scroll bars on if and only if the argument is positive. This command applies to all frames, including frames yet to be created.


2 Answers

Try these

 (tool-bar-mode -1)
 (menu-bar-mode -1)
 (scroll-bar-mode -1)

UPDATE:
Conventionally one should give negative argument to disable a minor mode. Please refer the emacs manual page. (with in emacs type: C-h r m minor modes RET

like image 80
kindahero Avatar answered Oct 17 '22 12:10

kindahero


Historically, a nil argument passed to a minor-mode has meant to toggle the minor mode (i.e. the code you used might enable or disable each of those mior modes depending on what is their initial value before loading the .emacs). In Emacs-24, I changed this so that nil means "enable" unconditionally.

This decision was taken because nil typically occurs when the arg is simply not provided, as in (flyspell-mode) or in (add-hook 'text-mode-hook 'flyspell-mode), and in those cases, the user typically really means "enable" rather than "toggle".

like image 43
Stefan Avatar answered Oct 17 '22 12:10

Stefan