3

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
/opt/local/bin/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:

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

Suggestions?

2
  • You might try emacsclient --version and compare that to the version of your Emacs.app.
    – Stefan
    Jul 24, 2016 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, 2016 at 1:54

1 Answer 1

1

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.

1
  • 1
    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. Jul 25, 2016 at 16:52

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.

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