Update 19 Oct 2012 Recent Emacs checkouts from the official repository have built-in fullsreen support. Although it does not yet work properly, it gives some hope for the future. My suggestion is to checkout, compile, and use the official version and then submit bugs so its quality can improve fast.

Mac OS X 10.7 (Lion) introduced an API for fullscreen applications. I prepared and submitted upstream a small patch that adds fullscreen support to Emacs using this API. The patch adds the standard fullscreen button to the window titlebar. Furthermore, the Emacs Lisp function ns-toggle-fullscreen is provided.


The instructions here do not work out-of-the-box under Lion. I assume that you know what you are doing. Having said that, the easiest way to obtain the patched Emacs is using Bazaar:

bzr branch lp:~k.efstathiou/emacs/fullscreen

Compilation is done with:

cd fullscreen
./configure --with-ns
make install

Note that autogen requires newer versions of automake and autoconf than the ones installed by default on Lion. These can be installed with Homebrew, running

brew create http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz
brew install autoconf
brew create http://ftp.gnu.org/gnu/automake/automake-1.11.1.tar.gz
brew install automake

Alternatively, it is possible to download the patch separately and apply it to the Emacs source. The patch is available at https://gist.github.com/1355895 and it should be applied with patch -p1. For example, and provided that the working directory is the Emacs source top-level directory, run:

curl https://raw.github.com/gist/1355895 | patch -p1

and then (re-)compile.

The Emacs source code is available from the Emacs Bazaar repository. Note that the patch applies cleanly to revision number 106343. Somewhat more stable (pretest) versions of Emacs 24 are available from http://alpha.gnu.org/gnu/emacs/pretest/ and it is possible, but untested, that the patch also applies cleanly to them.

Known bugs

If the frame toolbar is toggled while the frame is fullscreen there will be drawing problems that can be solved only by restarting Emacs.

Previous work

The patch here is based on a patch by Paul Ingles. The latter also uses the 10.7 APIs but has some (minor) appearance problems that I tried to solve with my patch.

An earlier patch for Emacs fullscreen support by Brett Hoerner has already been available for Emacs 23. Variations of it are used in Aquamacs but it never made it to the Emacs upstream. Since this earlier patch does not use the 10.7 API it has the advantage that it also works under OS X 10.6 but, unfortunately, under 10.7 when the window goes fullscreen it is not assigned its own space. I used some code from Brett’s patch but I did not try to make my patch play nicely with it since, first, I am not interested in support for pre-10.7 systems and, second, I prefer that each fullscreen window gets its own space.