22

Someone (in another SE answer) mentioned a feature thats only available in 26, so I guess now I gotta upgrade.

How do you install emacs 26 on macOS Sierra?

What I tried:

Googled how install emacs 26 Mac, brew install emacs.

1
  • 1
    If you like brew, then use brew. If you like the ease of downloading a self-contained bare-bones pre-packaged app, then have a look at the Other Versions link on emacsformacosx.com If you like building your own, then do that -- you just need git, recent versions of autoconf and automake and the command line developer tools on OSX.
    – lawlist
    Dec 2, 2017 at 5:50

7 Answers 7

17

Have a look at brew emacs recipe options with brew info emacs. It has this option:

--devel
    Install development version 26.0.90

To replace your current emacs, run:

brew unlink emacs
brew uninstall emacs
brew install emacs --devel --with-modules --with-cocoa --with-gnutls \
    --with-librsvg --with-mailutils --with-imagemagick@6
brew linkapps

The imagemagick@6 library and emacs devel change frequently so exclude them from automatic updates and do updates manually at convenient times:

brew pin imagemagick@6 emacs
1
  • I am having following output: Error: invalid option: --devel
    – alper
    Oct 29, 2020 at 15:06
10

A current (at time of this comment) way to install the GUI version of Emacs (26.2 at this time) on macOS Mojave is with

brew cask install emacs

This will install Emacs.app package in to /Applications and setup links. You can launch Emacs via Spotlight or from terminal as expected.

2
  • 3
    Just for people who come across this, it's now brew install --cask emacs --no-quarantine, with the no-quarantine being because of issues with MacOS security.
    – hartshoj
    Jan 19, 2021 at 18:03
  • Can I do this and tell it to get a specific unreleased version? I have 28.2 but I want to try out version 29.
    – Rob N
    Mar 3 at 21:04
8

Unfortunately brew linkapps is now deprecated.

You can use brew cask install emacs but it doesn't allow you to download emacs 26 as of 4/1/2018. EDIT: As Guilherme Salomé pointed out, now brew cask install emacs will install version 26.1.

You can though download the build you want from https://emacsformacosx.com/builds.

2
  • 5
    brew cask install emacs is working now, it is currently downloading the 26.1 version Feb 14, 2019 at 14:57
  • It installs version 27.1
    – alper
    Oct 29, 2020 at 14:58
6

This only installs the terminal version of Emacs 26.1. If you (like me) prefer to use the GUI version of Emacs then you can't install it with

brew install emacs

This is because the people who maintain brew have found it cumbersome to maintain and test all the versions and custom options of multiple formulas. They have since then dropped support for custom options and encourage users to maintain their own taps. As others have mentioned you can use the emacs-mac version or you can also use the emacs-plus version but if you prefer to use the unedited version and with custom flags to support color-fonts, ImageMagick support and all, I suggest you use the version using the following tap homebrew-emacs-head.

brew tap daviderestivo/emacs-head
brew install emacs-head --with-cocoa
  • if you prefer the emacs-head version (presently 27.x)
brew tap daviderestivo/emacs-head
brew install emacs-head --HEAD --with-cocoa

  • If you prefer the emacs-head version (26.3)
brew tap daviderestivo/emacs-head
brew install emacs-head --with-cocoa
brew install emacs-head@26
ln -s /usr/local/opt/emacs-head@26/Emacs.app /Applications
sudo ln -s /usr/local/opt/emacs-head@26/Emacs.app/Contents/MacOS/Emacs \
           /usr/local/bin/emacs  # This might be useful if you define `emacs` as your editor in .gitconfig file
alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs -nw"
5

MacOs has its own Emacs. In 2019 it's still 22.x. To use the last Emacs version do

  1. In Terminal run brew cask install emacs - it will install the latest emacs version to /Applications folder.
  2. Then edit (or create if you still don't have) your ~/.bash_profile file adding a new line

    alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs -nw'.

  3. Then run in Terminal source ./bash_profile to update bash environment.
  4. Then run in Terminal emacs -version to ensure that you use the latest Emacs version.

This will let you use Emacs terminal version. If you want to use Emacs UI, just remove -nw in the step 2.

1
  • Installed the GUI version via the web page emacsformacosx.com and was looking for a way to avoid re-installing via brew. The alias did the trick (accessing the installation from Apps folder). Thanks!
    – Ugur
    Jul 16, 2020 at 12:13
0

Today on Big Sur brew install emacs wasn't working for me.

brew install homebrew/cask/emacs did the trick though.

0

If you want to stick with Emacs version 26 install it from the source:

export LDFLAGS="-L/usr/local/opt/libxml2/lib"
export CPPFLAGS="-I/usr/local/opt/libxml2/include"
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"

TAG="26"
git clone --depth 1 --branch emacs-${TAG} git://git.savannah.gnu.org/emacs.git
cd emacs
make clean
./autogen.sh
./configure --without-compress-install --with-json --with-dbus --with-librsvg --with-imagemagick --with-mailutils

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.