12

I believe, there are three ways to build emacs on osx --- x11, ns (nextstep?), and cocoa. Can anyone explain what the build options mean / the difference between these three are?

3
  • 1
    It has been a few months since I built the x11 version on OSX, but it took me a little bit of time to figure out that it was necessary to use --with-ns=no --with-x as part of the command line options. I mention this just in case anyone else is interested in building the x11 version on OSX. I would imagine that the accepted answer will include a mention of the materials needed for a successful build -- e.g., XQuartz (The X Window System), etc.
    – lawlist
    Nov 22, 2016 at 20:57
  • @lawlist ah, good to know! one of the reasons for me asking this question is because I was looking to build emacs with x11 (for xwidgets) on osx, but I was wondering if I would lose anything from going from NS to x11.
    – user12502
    Nov 23, 2016 at 0:35
  • 1
    See this related thread entitled "Compile emacs with xwidget under OSX?": emacs.stackexchange.com/questions/25037/… The custom keyboard shortcuts that I rely upon in the GUI version of Emacs built --with-ns don't work in the x11 version, so I haven't really been able to use the x11 productively yet. I would need to learn how to configure alternative keyboard shortcuts in x11 -- the Linux users would probably be right at home with the x11 version, but I'm kind of lost.
    – lawlist
    Nov 23, 2016 at 2:24

1 Answer 1

16

There are a number of Emacs versions for macOS, including:

  • The official Emacs on macOS is build using the "NS" port, also known as the "cocoa" port. As the name suggests, this port of Emacs originates in Emacs for the NextSTEP operating system and has been the official Emacs GUI on macOS since Emacs 23.

  • Mitsuharu Yamamoto-san maintains the "Mac port" of Emacs. It provides an alternative GUI with a different feature set compared to the NS port. This originates from the Emacs port to Mac OS 8/9 and the "Carbon" port of Emacs 22. (This port is also referred to as the "railway cat" Emacs, as this is where the brew recipe is hosted.)

  • Aquamacs is based on the NS port of Emacs and contains a number of enhancements making it behave more like traditional macOS applications.

  • X11: It is possible to build Emacs with the same GUI as used on X11 system, however it requires a X11 server to run. Unfortunately, the end result will not have macOS look and feel -- things like menus looks as though you were running on a unix-like system. In fact, this is not one GUI but a family of GUI:s as it's possible to build using different X11 support libraries like GTK+.

  • Terminal only. This gives you an Emacs that only can run in a terminal window, much like a GUI Emacs behaves when passed the -nw option.

So, which should you pick?

If you are lazy, pick the official Emacs -- you can download a prebuilt version from https://emacsformacos.com.

If you want to spend some time on getting the best Emacs for you, try both the official Emacs and the "mac" port. Overall, they are fairly similar but provides a slightly different feature set.

Generally, I would not recommend using the X11 port as you wont get macOS look and feel, however in some situations it might be of interest:

  • You want a feature only available in the X11 port, like support for xwidget
  • You are accustomed to X11 and want the exact same look and feel when using Emacs on macOS
  • You want a "reference" implementation of Emacs, e.g. when contributing to the NS port of Emacs.
3
  • you might also need the x11 variant if you are installing it on a remote host you're ssh-ing into :-)
    – UpAndAdam
    Feb 28, 2020 at 15:54
  • What about Doom Emacs or Spacemacs ? Could you update the post to include them ? Oct 31, 2021 at 6:28
  • @LudovicKuty, unfortunately no, since I don't know anything about them. However, I think that they are independent of the Emacs variant used and only change things on the lisp-side. Oct 31, 2021 at 12:24

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.