I have been using OS X forever. I have been using Emacs forever. I currently use the MacPorts Emacs.app and do (server-start) in my .emacs file. I can't get emacsclient going:

> which emacsclient
>  emacsclient ~/.emacs
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor.  Please use:

        --server-file      (or environment variable EMACS_SERVER_FILE)
        --altstrong texternate-editor (or environment variable ALTERNATE_EDITOR)


  • You might try emacsclient --version and compare that to the version of your Emacs.app. – Stefan Jul 24 '16 at 22:13
  • Try running emacsclient -ca "" The 'c' option tells emacs to open a new frame. The 'a' option, when passed the empty string, will cause an instance of the daemon to be started if one is not already running. – mwood Jul 27 '16 at 1:54

Sounds like you are trying to use emacsclient before having started the server.

You have (server-start) in your init file, but did you actually start Emacs normally before trying to use emacsclient? If not, that's probably your problem: that call to server-start was not made before you invoked emacsclient.

An alternative is to use the --daemon command-line option when starting Emacs.

Node Emacs Server of the Emacs manual explains it.

  • Guess I should have clarified that before trying to use emacsclient I open Emacs.app, which has (server-start) in its init file. I have also tried executing server-startmanually after Emacs is running, and it says "server restarted". I am uncomfortable with the daemon approach because I use Emacs.app a lot and hardly ever try to use emacsclient, so even though it doesn't really matter, I would like to keep Emacs.app as the "primary" in this arrangement. – Mitchell Model Jul 25 '16 at 16:52

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.