I have installed emacs23 on Linux Mint 8. I would like to hide the toolbar, and I can do it with Options > Show/Hide > Tool-bar. But the Tool-bar comes back next time I start emacs. How can I hide it persistently?
5 Answers
Add the following to your init file (~/.emacs or _emacs or ~/.emacs.d/init.el):
(tool-bar-mode -1)
- 109
- 4
- 1,029
- 1
- 12
- 19
-
Could `false` be used instead of `-1` as the value to achieve the same result? – leifericf Feb 08 '21 at 07:14
-
@Leif I don't know about `false`. But you *can* do `0`, which is what I use, and that's pretty well understood to be false-y. – mtraceur Jul 10 '21 at 21:40
Emacs has a nice built-in customization interface.
Select Options › Customize Emacs › Specific Option, start typing tool, then hit TAB to see the options starting with tool. Choose tool-bar-mode then. Toggle its value to switch it off, and press Save for future sessions.
- 2,039
- 3
- 24
- 28
-
Thanks, this was a more general solution. But when I pressed "Save for future sessions", I got "Cannot save customixations; init file was not fully loaded" ...so I think I have some problem with my `.emacs`-file, but I don't understand it. – Jonas Apr 08 '10 at 15:08
-
4Sanoj: the best fix for that, if you don't know any lisp, is to make an empty .emacs, and then copy parts of your old .emacs in one at a time and make sure no errors show up in the *Messages* buffer at startup for each portion you add back in. Or you can put a ";" before lines to comment them out, and follow a similar process of uncommenting a small section, and making sure there are no errors when you restart. – Justin Smith Apr 12 '10 at 07:11
Just for future reference.
~/.emacs file with tool-bar, menu-bar and scroll-bar hidden
;; Disabling things
;;-----------------------------------------------------------------------
(menu-bar-mode -1)
(toggle-scroll-bar -1)
(tool-bar-mode -1)
;;Note: If, after turning any of these off, you want to re-enable them for a single emacs window, you can do so by pressing Meta-x and then typing the command at the M-x prompt. (Copied from Web)
;;Example:
;;M-x tool-bar-mode
;;will turn the toolbar back on.
;;-----------------------------------------------------------------------
Now, your emacs will look like this.
- 161
- 1
- 4
I agree with michael. But if you only add this line to your .emacs file, there will be errors when you run emacs in the command line mode. Thus, a better solution may be adding the following to you .emacs file:
(if window-system
(tool-bar-mode -1)
)
so that, tool bar will be hidden only when you run it in GUI. Emacs in command line mode does not seem to have a tool bar.
- 159
- 1
- 4
I found this thread but none of the answers helped me directly. I wanted to hide the tab bar rightaway but I wanted to also be able to show it if needed.
So after some searching and then RTFM I realized that one can do M-x toggle-frame-tab-bar. This is handy as you can bind it to a key and toggle it whenever you want it in that particular frame. In Emacs 28.2 it seems like there is a bug and the frame is not refreshed/repainted after the toggle, but when you move the point (e.g C-n) then you see the effect of the toggle.
- 251
- 3
- 5