4

Ive installed Emacs via http://emacsformacosx.com/

In ~/.emacs.d/init.el

(tool-bar-mode -1)
(toggle-frame-maximized)

Which is supposed to maximize Emacs when it starts up. It does some kind of maximization, but leave a gap at the top (between the menubar, below the Apple logo). As you can see on the screenshot:

enter image description here

How do I ensure that Emacs fills up the screen.

PS, I am not looking from full-screen mode.

Christian Fazzini
  • 19,613
  • 21
  • 110
  • 215
  • Your observation is just one of the many reasons why I use my own function: http://stackoverflow.com/a/18711628/2112489 I prefer not to maintain multiple answers with the same content (since I may update prior answers with bug fixes / improvements as time goes by, and I like to provide links to one central answer), so I won't be posting that same information as an answer to your particular question even though it certainly applies here. – lawlist Jan 04 '15 at 00:08

2 Answers2

10

From C-h f toggle-frame-maximized:

Note that with some window managers you may have to set `frame-resize-pixelwise' to non-nil in order to make a frame appear truly maximized.

So in your init.el, do (setq frame-resize-pixelwise t) before toggling.

In my experience, even after setting this variable to t, the first time I maximize, the frame is still not "truly" maximized. On subsequent calls to toggle-frame-maximized, the frame actually expands to fit.

So here's the workaround...

init.el:

(tool-bar-mode -1)
(setq frame-resize-pixelwise t)
(dotimes (n 3)
  (toggle-frame-maximized))

I would suggest that you turn off window animations so that you don't need to suffer through that ridiculous series of window resize animations on startup, but unfortunately the latest versions of Mac OS seem to have removed the ability to disable window animations.

I suggest not using that OS. It is terrible.

Jackson
  • 9,188
  • 6
  • 52
  • 77
0

Just to provide a little more information for other people that experience the same problem.


I've taken the following steps:

  1. Did M-x toggle-frame-maximized once.

    results:

    • The window became maximized
    • The gap at the bottom was gone
    • The gap at the right was gone
    • Resizing the window returned the right gap
    • Restarting Emacs made the gaps return
  2. put (setq frame-resize-pixelwise t) at the top of my init.el.

    results:

    • No more visible gap.
    • Restarting Emacs keeps no visible gap.

There are different versions of Emacs available through homebrew. Both d12frosted/emacs-plus and railwaycat/emacsmacport require you to manually tap these brews.

Formulae

  • emacs-plus
  • emacs
  • emacs-clang-complete-async
  • emacs-dracula
  • emacs-mac

Casks

  • emacs
  • emacs-nightly
  • emacs-pretest
  • emacsclient
  • eqmac
  • emacs-mac
  • emacs-mac-spacemacs-icon

If you install a brew formula, it won't be able to display a GUI. Just don't use this. Make sure you check your brew list, because emacs often gets added as a formula as a dependency!

Make sure it is completely uninstalled from your system, and clean up the cache and symlinks if brew didn't do so already.

Of all the cask versions, only emacs --cask, emacs-nightly and emacs-pretest suffer from the gap problem.


I still use emacs --cask though. The problem is easily solved by adding 1 line to my init.el and I no longer get any bugs with double space ligatures

emacs --cask is the only version that can correctly display glyphs like \ f ( = ( correctly on my system.

moi2877
  • 55
  • 10