emacs-mac by Mitsuharu Yamamoto enhances vanilla GNU Emacs by enabling various Safari-like conveniences, such as tabs and tab overview and back/forward swiping between buffers. It also enables various Mac-specific Elisp commands, such as (mac-auto-operator-composition-mode)
to enable font ligatures.
You can install a pre-built binary with the Homebrew formula provided by railwaycat. But be aware that you can't launch it from Spotlight, because it doesn't install Emacs.app
in /Applications
(you'd have to do that manually).
brew install autoconf gnutls pkg-config texinfo
Since texinfo
is keg-only (cf. brew info texinfo
), you'll need to (temporarily) add the makeinfo
path to PATH
in order to build the Emacs manuals (info files):
export PATH="/usr/local/opt/texinfo/bin:$PATH"
Clone the emacs-mac repo:
git clone https://bitbucket.org/mituharu/emacs-mac.git
Configure it:
cd emacs-mac
./autogen.sh
./configure CC="clang -fobjc-arc" --with-mac --enable-mac-app --with-modules --with-gnutls
Build and install:
make
sudo make install
The app will be installed to /Applications/Emacs.app
.
On macOS 10.14 (Mojave), make
may stop with the following error:
... fatal error: 'libxml/tree.h' file not found
#include <libxml/tree.h>
^~~~~~~~~~~~~~~
1 error generated.
If so, you need to install additional header files:
sudo installer \
-pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg \
-target /
Alternatively, you can drop XML parsing support with the configure
switch --without-xml2
(see above).
You may need to install the info files manually, if you find that the entries listed by C-h i
don't match those in the file info/dir
(e.g., no entry for the Emacs Lisp Reference Manual).
sudo make install-info