20

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 '17 at 5:50
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 '20 at 15:06
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 – Guilherme Salomé Feb 14 '19 at 14:57
  • It installs version 27.1 – alper Oct 29 '20 at 14:58
8

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.

1
  • 1
    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 at 18:03
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 '20 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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