Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Tool bar, menu bar and scroll bar are not disabled in emacs 27 (macOS) #2354

Closed
howsiwei opened this issue Jan 11, 2020 · 6 comments
Closed
Labels
is:upstream Originates from outside the project and cannot be fully addressed here re:chemacs Has to do with Chemacs, the Emacs config bootloader re:emacs:27 Pertains to Emacs 27.x or newer re:interface Pertains to window/frame management and buffer layout wontfix This will not be worked on

Comments

@howsiwei
Copy link
Contributor

howsiwei commented Jan 11, 2020

What did you expect to happen?
Tool bar, menu bar and scroll bar are disabled.

What actually happened?
Tool bar, menu bar and scroll bar are not disabled.

Additional details:
According to the documentation of variable tool-bar-mode,

Setting this variable directly does not take effect;
either customize it (see the info node (emacs)Easy Customization)
or call the function tool-bar-mode.

So I changed

(setq tool-bar-mode nil)

to

(tool-bar-mode 0)

However, it still doesn't work until I move the code from early-init.el to init.el. (Using the setq method in init.el doesn't work.)

Similarly, I removed

(setq menu-bar-mode nil)

in early-init.el
and add

(menu-bar-mode 0)

in init.el.
Finally, I moved

 (when (fboundp 'set-scroll-bar-mode)
   (set-scroll-bar-mode nil))

from early-init.el to init.el to remove the scroll bar.

System information:

((emacs
  (version . "27.0.60")
  (features . "RSVG IMAGEMAGICK GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER LCMS2 GMP")
  (build . "Jan 12, 2020")
  (buildopts "--disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-plus/HEAD-f0ebd91/share/info/emacs --prefix=/usr/local/Cellar/emacs-plus/HEAD-f0ebd91 --with-xml2 --without-dbus --with-gnutls --with-imagemagick --with-json --with-modules --with-rsvg --with-ns --disable-ns-self-contained")
  (windowsys . batch)
  (daemonp . server-running))
 (doom
  (version . "2.0.9")
  (build . "HEAD -> develop 18301b0b9 2020-01-10 05:59:54 -0500")
  (dir . "~/.config/doom/"))
 (system
  (type . darwin)
  (config . "x86_64-apple-darwin19.2.0")
  (shell . "/usr/local/bin/zsh")
  (uname . "Darwin 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov  9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64")
  (path "/usr/local/Cellar/zplug/2.4.2/bin" "/usr/local/opt/zplug/bin" "/usr/local/sbin" "~/bin" "~/sbin" "~/.local/bin" "/usr/local/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/Library/TeX/texbin" "/opt/X11/bin" "/Applications/Wireshark.app/Contents/MacOS" "/usr/local/Cellar/emacs-plus/HEAD-f0ebd91/libexec/emacs/27.0.60/x86_64-apple-darwin19.2.0"))
 (config
  (envfile . envvar-file)
  (elc-files . 2)
  (modules :completion company ivy :ui doom-dashboard hl-todo modeline (popup +all +defaults) vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold multiple-cursors rotate-text snippets word-wrap :emacs dired electric ibuffer vc :term shell :checkers syntax :tools (eval +overlay) (lookup +docsets) lsp macos magit pdf :lang (agda +local) (cc +lsp) data emacs-lisp (latex +latexmk) markdown (org +dragndrop +present) (python +conda +cython +lsp) sh :config (default +bindings +smartparens))
  (packages "(ccls :disable t)" doom-themes solarized-theme "(conda :recipe (:host github :repo \"howsiwei/conda.el\"))")
  (elpa "n/a")))
@howsiwei howsiwei added the is:bug Something isn't working as intended label Jan 11, 2020
@howsiwei howsiwei changed the title [BUG] [BUG] Tool bar, menu bar and scroll bar are not disabled Jan 11, 2020
@howsiwei howsiwei changed the title [BUG] Tool bar, menu bar and scroll bar are not disabled [BUG] Tool bar, menu bar and scroll bar are not disabled in emacs 27 Jan 11, 2020
@howsiwei howsiwei changed the title [BUG] Tool bar, menu bar and scroll bar are not disabled in emacs 27 [BUG] Tool bar, menu bar and scroll bar are not disabled in emacs 27 (macOS) Jan 11, 2020
@hlissner
Copy link
Member

Is it possible that you installed a version of Emacs 27 before it early-init.el was implemented? These lines are disabled in Emacs 27 because they're redundant with the work done in early-init.el.

@hlissner hlissner added module:core Relevant to Doom core re:emacs:27 Pertains to Emacs 27.x or newer re:interface Pertains to window/frame management and buffer layout status:unconfirmed Still under investigation. and removed is:bug Something isn't working as intended labels Jan 11, 2020
@howsiwei
Copy link
Contributor Author

Is it possible that you installed a version of Emacs 27 before it early-init.el was implemented?

I don't think so. I installed Emasc 27 with

brew install emacs-plus --with-emacs-27-branch --HEAD --with-jansson --with-modern-icon

and the resulting Emacs is built using commit f0ebd919c16c71d1010f2625425932e46b58f8b4, which is the latest commit on emacs-27 branch with the latest commit committed 13 hours ago.

Also note that the documentation of early init file says that

   We do not recommend that you move into ‘early-init.el’ customizations
that can be left in the normal init files.  That is because the early
init file is read before the GUI is initialized, so customizations
related to GUI features will not work reliably in ‘early-init.el’.  By
contrast, the normal init files are read after the GUI is initialized.
If you must have customizations in the early init file that rely on GUI
features, make them run off hooks provided by the Emacs startup, such as
‘window-setup-hook’ or ‘tty-setup-hook’.  *Note Hooks::.

@hlissner
Copy link
Member

hlissner commented Jan 14, 2020

I understand that. The purpose of those settings were to set them early enough that Emacs won't initialize them when they eventually load. tool-bar-mode is enabled by default, but hasn't been loaded yet in early-init.el. By setting the variable to nil ahead of time, the mode should not be auto-enabled when it is loaded. So unless tool-bar.el.gz is loaded earlier on macOS than it is on Linux (where these lines work properly), it should behave as expected.

I don't have a mac to test on atm. I'll investigate when I get a chance.

@hlissner hlissner added status:unknown Cause unknown; cannot be reproduced; cannot investigate further and removed status:unconfirmed Still under investigation. labels Jan 23, 2020
@hlissner
Copy link
Member

hlissner commented Jan 23, 2020

I can't reproduce this. I loaded up two VMs, one in Mojave, one in Catalina. I installed Emacs with:

brew install emacs-plus --with-emacs-27-branch --HEAD --with-jansson --with-modern-icon
git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
emacs

Emacs opened with the menu bar, tool bar and scroll bars disabled, as intended.

@howsiwei
Copy link
Contributor Author

@hlissner you're right. After investigation I found out that the bars were not disabled because I was using chemacs which doesn't load the early-init.el file. Without chemacs tool bar and scroll bars are correctly disabled. Menu bar is still enabled but that's the expected behavior in macOS [1].

[1] https://emacs.stackexchange.com/questions/941/emacs-and-os-x-menu-bar

@hlissner hlissner added is:upstream Originates from outside the project and cannot be fully addressed here re:chemacs Has to do with Chemacs, the Emacs config bootloader wontfix This will not be worked on and removed module:core Relevant to Doom core status:unknown Cause unknown; cannot be reproduced; cannot investigate further labels Jan 26, 2020
GTrunSec pushed a commit to GTrunSec/doom-emacs that referenced this issue Feb 9, 2020
@jakebox
Copy link

jakebox commented Nov 30, 2020

Just in case anyone else finds this like I did: Chemacs 2 solves the issue as it has support for early_init.el. Works very nicely with Doom.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
is:upstream Originates from outside the project and cannot be fully addressed here re:chemacs Has to do with Chemacs, the Emacs config bootloader re:emacs:27 Pertains to Emacs 27.x or newer re:interface Pertains to window/frame management and buffer layout wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants