purcell / emacs.d

An Emacs configuration bundle with batteries included
BSD 2-Clause "Simplified" License
6.87k stars 2.06k forks source link

Where is your menu bar configuration? #434

Closed yuzumx closed 7 years ago

yuzumx commented 7 years ago

Hello, Purcell. Your configuration is very useful for my learning emacs. but I have a little problem:

I want to disable the titlebar(The effect looks like spacemacs or redguardtoo/emacs.d ). Because I think the titlebar is very very useless and ugly.

but in your configuration , I don't know where your titlebar configuration is..... So It's very kind of you again, sorry.

Thank you.

purcell commented 7 years ago

Normally you would just make your frame full-screen using something like M-x toggle-frame-fullscreen. Is that what you meant?

yuzumx commented 7 years ago

No ,It isn't what I mean. I want to disable "File Edit ...." bar. , It isn't fullscreen.

yuzumx commented 7 years ago

Sorry ,I'm wrong. I should call it "menubar" I want to disable that displays "File Edit ..." bar

I really think that bar is very useless and ugly. Would you like to tell me why you will enable it by default in your configuration ? If you are offended please forgive me. Thank you.

purcell commented 7 years ago

I actually don't know why you're seeing the menu bar. It's disabled in my config, because I agree that it's not terribly helpful. Perhaps there's an error in your config before the code in init-gui-frames.el is executed?

If not, you can also choose M-x customize-variable, then enter menu-bar-mode, change to nil and save.

yuzumx commented 7 years ago

@purcell I don't understand what you mean.....In your default configuration, the menu bar is closed? I keep the default settings all the time. But the menubar always displayed.

The second way you say is valid. However,When I reinstall your configuration , the menu bar will appear again.

I tested it in all GTK3 and GTK2 Window Manager ,Like :

GNOME
Awesome WM
i3wm
FVWM
Unity (on ubuntu and archlinux)

In addition to Unity the menu bar is displayed at the top of screen (This seems to be the default setting for unity, because all programs are like this.),others are displayed in the Windows-like position (at the top of window) . And the menubar is also displayed by OS X's default rule on OS X.

yuzumx commented 7 years ago

I remind you that if disabled the menu bar on OS X, the panel should have nothing. The menu bar is enabled:

2017-04-30 8 04 38

The menu bar is disabled(by customize-variables):

2017-04-30 8 05 49

disabled on Awesome WM: virtualbox_arch linux_30_04_2017_20_45_23

Although M-x customize-variables can work, but I need to reset emacs often. So I hope for you to solve this problem. Thank you very much.

JiaHong-Lee commented 7 years ago

Notice that too when I first used Mr. Steve's configuration few weeks ago.

Now tried again downloading and loading Mr. Steve's configuration, and can confirm that the configuration does not hide the menu-bar by default, so I hide it by adding this line to my init.el:

;; DISABLE MENU-BAR
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))

Hope that it helps. Thanks!

My environment: Windows 10 Version 1607 (OS Build 14393.1066) Emacs build of GNU Emacs 25.1.1 (i686-w64-mingw32) of 2016-11-16

yuzumx commented 7 years ago

@JiaHong-Lee I know this way. But I think Mr. Steve does not seem to notice the menu bar in other WM will be displayed. I think it because Mr. Steve also seems to want to hide the menu bar by default.

I don't know what OS he uses. This problem seems to be hidden on the OS he uses.

yuzumx commented 7 years ago

Thank you.

purcell commented 7 years ago

@YuanPres Thanks for the report and related discussion. I'm on OS X and never had an issue with this, but I'm happy to commit this change because I do indeed want the menu bar to be hidden by default in all frame types.

yuzumx commented 7 years ago

@purcell Sure, The position of the macOS menu bar is very strange... It looks like no menu bar. HAHAHA! And... I have just tested the new version on all the WM and DE I use and macOS 10.12.4 This time they all work fine. Thank you very much! 👍

yuzumx commented 7 years ago

@purcell I have a question for this issue to ask you for advice: Would you like to tell me what the code is doing?

~/.emacs.d/lisp/init-gui-frames.el:

...
(add-hook 'after-make-frame-functions
          (lambda (frame)
            (with-selected-frame frame
              (unless window-system
                (set-frame-parameter nil 'menu-bar-lines 0)))))
...

I have tried to change this code to fix this issue, but it is invalid. Please forgive my foolishness...

purcell commented 7 years ago

I think the intention was to disable the menu bar only in terminal frames: I only use OS X currently, where menu-bar-mode has no effect. So the code says "when you've made a frame, then if it's a terminal frame, set the menu bar height to 0."

yuzumx commented 7 years ago

Thanks for your patience. And……Now that you have completely closed the menu bar in the previous code. So can I remove this code? (I have some obsessive-compulsive disorder……haha) @purcell

yuzumx commented 7 years ago

Thanks. It meets my expectations.