14
votes

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?

2
Rather than calling the function, I have global variable tool-bar-mode set to nil, which seems to work. Otherwise as @kindahero says, call the function with a negative number. You can see this in the docs for tool-bar-mode using M-x aproposMark Aufflick

2 Answers

25
votes

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

11
votes

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".