Fork me on GitHub
#spacemacs
<
2022-04-03
>
happyb3at04:04:09

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

Martynas Maciulevičius07: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.

practicalli-johnny11:04:00

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

happyb3at13:04:00

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???

happyb3at14:04:56

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

practicalli-johnny14:04:18

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

happyb3at14:04:42

in core-early-funcs.el

happyb3at14:04:46

(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)))

happyb3at14:04:06

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.

happyb3at14:04:36

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)

happyb3at14:04:20

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?

happyb3at14:04:24

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

happyb3at14:04:36

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

practicalli-johnny17:04:57

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.