panache
panache

Reputation: 311

emacsclient unable to find emacs server

I have this setup for emacs on my Mac. 1. Downloaded the distro from http://emacsformacosx.com/. 2. Followed the tips here http://emacsformacosx.com/tips to set up emacs and emacsclient appropriately.

However the following sequence of steps does not work for me: 1. emacs filename - opens up the file 2. emacsclient -n filename - gives me an error saying that I have not started up the server. But I do have (server-start) in my .emacs file. So I am not sure why I am getting this error.

Nevertheless, I did C-x restart-server in the emacs window and then tried to use emacsclient to attach to it (to open another file) but I still get the same error.

Other things I have tried: 1. Added (setq server-socket-dir (format "/tmp/emacs%d" (user-uid))) and say that the server was starting up in the /tmp location when I launch emacs. 2. Tried various args for emacsclient (new frame, attach to existing frame etc). All give me the same error.

My guess is that emacsclient is unable to find the server I have started up. But I am not sure how to confirm this and/or how to fix it.

Any ideas? Thanks.

Upvotes: 1

Views: 526

Answers (1)

panache
panache

Reputation: 311

So turns out that adding the line specifying the socket was a mistake. Removing it worked for me and emacsclient was able to find the emacs server just fine.

Another way I tested it was leaving the socket line in and then using the -s option with emacsclient to connect to that specific location (/tmp/emacs501/server) and that worked too.

Upvotes: 1

Related Questions