5

I upgraded to Emacs 26.2 on my Mac OSX Sierra instance via "brew".

After the upgrade, the emacs command will not open a new "GUI window", i.e. it runs as if I passed the -nw args or ran it from an ssh session.

I.e. it does not seem to recognize the Mac windowing system:

This behavior has changed since yesterday.

From the docs Using Emacs with X Emacs has been tailored to work well with the X window system. If you run Emacs from under X win- dows, it will create its own X window to display in. You will probably want to start the editor as a background process so that you can continue using your original window.

How can I launch Emacs without it being in terminal (nw) mode?

2
  • 1
    Are you sure you're using the Homebrew version of Emacs and not the Apple provided version (22.1.1) at /usr/bin/emacs?
    – nega
    Apr 15, 2019 at 19:58
  • 1
    You may also want to look at the Homebrew cask, emacs. This will give you a nicely "brewed" package from emacsformacosx.com. Install it with brew cask install emacs
    – nega
    Apr 15, 2019 at 20:03

2 Answers 2

7

You want to use the Homebrew cask for Emacs. That will install a "brewed" package of Emacs from https://emacsformacosx.com/.

brew cask install emacs

The "regular" Homebrew package for Emacs is built without GUI support. Via brew edit emacs:

  def install
    args = %W[
      --disable-dependency-tracking
      --disable-silent-rules
      --enable-locallisppath=#{HOMEBREW_PREFIX}/share/emacs/site-lisp
      --infodir=#{info}/emacs
      --prefix=#{prefix}
      --with-gnutls
      --without-x
      --with-xml2
      --without-dbus
      --with-modules
      --without-ns
      --without-imagemagick
    ]

Note the flag --without-ns. This disables the GUI on macOS.

2
  • Woohoo! back in business! I do wonder "what changed" for me over the last day. Also, I lost my default font settings, but a small price to pay for "ctrl-k to the clipboard"
    – user331465
    Apr 16, 2019 at 2:05
  • I had a similar problem, but brew claimed Emacs was already installed this way. Reinstalling fixed it. No idea why. IIRC I could still get GUI emacs by launching from Spotlight, but not from Terminal.
    – Cyberthal
    Mar 21, 2021 at 20:44
0

i had the same problem, and tried the solution from @nega but it did not work for me. i am not a homebrew expert, but the command as listed didn't work and i had to use this syntax:

brew install --cask emacs

but like i said, the emacs window didn't open in X11.

i had success with the macports install instead of the homebrew install:

sudo port install emacs +x11

solution courtesy of @mariusm stackoverflow 2016

Your Answer

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

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