Building a fullscreen enabled Emacs 24 on Mac OS X Snow Leopard
I have tried a couple of different approaches to build a working Emacs 24 for OS X that has the M-x ns-toggle-fullscreen enabled. Finally, a modification of that procedure worked with the most recent git HEAD at the time of writing. Copy and paste from here or grab the Gist. Alternatively, I offer builds for download here.
git clone git://git.savannah.gnu.org/emacs.git
cd emacs
wget http://cloud.github.com/downloads/hh/emacs/feature-fullscreen.patch
patch -p1 -i feature-fullscreen.patch
curl -O http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz
tar -xzvf m4-1.4.13.tar.gz
cd m4-1.4.13
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
tar -xzvf autoconf-2.65.tar.gz
cd autoconf-2.65
./configure --prefix=/usr/local # ironic, isn't it?
make
sudo make install
cd ../emacs
# here you might want to restart your terminal session, to ensure the
# new autoconf is picked up and used in the rest of the script; or do
# the following step first and then restart your terminal session:
# to ensure that /usr/local/bin/autoconf gets picked up instead of the
# older /usr/bin/autoconf (mine wasn't by default, and you can remove
# these lines after the build):
echo 'PATH="/usr/local/bin:${PATH}"' >> ~/.bash_profile
echo 'export PATH' >> ~/.bash_profile
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
tar xzvf automake-1.11.tar.gz
cd automake-1.11
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
tar xzvf libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure --prefix=/usr/local
make
sudo make install
cd ..
sh autogen.sh
./configure --with-ns
make && make install
mv /Applications/Emacs.app ~/.Trash/
mv nextstep/Emacs.app /Applications/
Now start Emacs from your applications directory, do M-x ns-toggle-fullscreen, and enjoy the fullscreen goodness!