Fork me on GitHub

Howto make spacemacs show menu-bar on startup? Adding (menu-bar-mode t) to user-config gets ignored?

Martynas M07:04:39

I have never used menu bar and didn't even know what it was for spacemacs. Instead I press Alt+x and search for a command.


(menu-bar-mode 1) should be added to the dotspacemacs/user-config section of .spacemacs configuration file to enable the Emacs menu on startup. Or press F10 key to enable the Emacs menu when Emacs is running. Be aware the Emacs menu is quite limited compared to the which-key menu via SPC , which provides a menonic guide to the large number of commands available for Emacs.


Yeah i tried (menu-bar-mode 1) to in dotspacemacs/user-config does still doesnt work. If i do M-x (menu-bar-mode) it does show. Just cant make it show permanently???


the menu bar does show briefly at startup but is then removed again


I assume something is disabling the Emacs menu after user-config is loaded, which is unusual as user-config is the last thing to load. I assume there must be a hook somewhere in the Spacemacs code that disables the Emacs menu. Suggest searching the Spacemacs code for menu-bar-mode I can take a quick look tomorrow if you can't find anything, but I really don't think it's worth doing


in core-early-funcs.el


(defun spacemacs/removes-gui-elements () "Remove the menu bar, tool bar and scroll bars." ;; removes the GUI elements (when (and (fboundp 'scroll-bar-mode) (not (eq scroll-bar-mode -1))) (scroll-bar-mode -1)) (when (and (fboundp 'tool-bar-mode) (not (eq tool-bar-mode -1))) (tool-bar-mode -1)) (unless (memq (window-system) '(mac ns)) (when (and (fboundp 'menu-bar-mode) (not (eq menu-bar-mode -1))) (menu-bar-mode -1))) ;; tooltips in echo-aera (when (and (fboundp 'tooltip-mode) (not (eq tooltip-mode -1))) (tooltip-mode -1)))


just cant see why i cant undo that using a simple (menu-bar-mode 1) in user-config since that one is supposed to be run as the last thing.


It gets called from core-spamacs.el (defun spacemacs/init () "Perform startup initialization." (setq command-line-args (spacemacs//parse-command-line command-line-args)) (when spacemacs-debugp (spacemacs/init-debug)) ;; silence ad-handle-definition about advised functions getting redefined (setq ad-redefinition-action 'accept) ;; this is for a smoother UX at startup (i.e. less graphical glitches) (hidden-mode-line-mode) (spacemacs/removes-gui-elements)


but even if i uncomment that line and save the file still no mojo. Do i need to do more than uncomment the line in core-spacemacs.el and then save the file and then restart emacs? Could there be a byte compiled version of the .el file I need to compile in order to pickup the uncomment of that line?


core-spacemacs.el dont contain the "shebang of no byte compile line" i.e. ;; -*-no-byte-compile: t; -*-


so really shouldnt be a compiled vs non compiled issue. but I am new elisp so maybe something I dont see 🙂


I don't know anyone who has used the Emacs menus with any community configuration. It's usually the first thing turned off. They are not something I would find valuable. I suggest creating your own Emacs configuration would be much more effective than changing design approach taken by Spacemacs and other configurations.