9

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?

  • 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 '16 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. – Nelson Liu Nov 23 '16 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 '16 at 2:24
11

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.

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.