2

When I run Emacs on macOS, it runs a new instance of the app. Is there a way that I can only ever run one instance?

If I double-click on the Emacs app icon (for example), and it's already running, it would just bring the existing instance to the front.

I'm on macOS 10.13.1 and Emacs 25.2 (9.0).

  • Are you calling Emacs from the command line and that is why you have more than one instance? What is wrong with using the Emacs.app icon to pull up an existing instance, or launch a new one if there is no Emacs process running already? – lawlist Nov 29 '17 at 4:45
  • Either when I enter emacs on the command line, or double-click on the Emacs icon in Finder, it happens. There is nothing wrong with opening two (or more copies), but keeping with how all other apps work on the Mac, opening one instance of apps is the norm. – Diego Barros Nov 29 '17 at 5:03
  • 1
    The pre-built binary from emacsformacosx.com should bring to the foreground the existing Emacs instance if you click-on it in the Finder or use Command+down. Same thing if Emacs has been added/dragged to the dock and you type Control-F3 to place focus to the dock, and type Emacs quickly, and then press the enter key. If you build Emacs from source using the --with-ns option, the same is true. [Building from source requires current versions of autoconf and automake and the command-line Developer utilities.] – lawlist Nov 29 '17 at 5:16
  • 1
    Also keep in mind that many versions of OSX ship with an outdated Emacs at /usr/bin/emacs, which has caused me problems in the past. And, I recently spent a bunch of time because etags ships with OSX and is also outdated. I'm glad you found the issue. Please feel free to write up an answer with the solution, and rephrase anything in the question or title so that the question/answer is helpful to someone who Googles a similar problem and/or searches this forum directly. You will be able to accept your own answer in something like 24 or 36 or 48 hours. – lawlist Nov 29 '17 at 6:16
  • 1
    Same thing started happening to me after I upgraded from OS X 10.12 to 10.13. – Heikki Nov 29 '17 at 14:54
1

I also find that the emacs 25.3 from https://emacsformacosx.com/ starts a new emacs process each time I do

$ open /Applications/Emacs.app

from the command line (MacOS 10.13.1)

As far as I can tell, this is new with MacOS 10.13

One fix: homebrew emacs raises the window instead of launching a new process:

$ brew install emacs --with-cocoa
$ brew linkapps 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.