1

I just want single instance. I just use a simple .emacs for config, which has

(use-package server :ensure t :init (server-mode 1) :config (unless (server-running-p) (server-start)))

It works on MS windows. But on Linux (Ubuntu 18 LTS)/Mac OS, then 2nd instance started with warning:

*Warning (server): Unable to start the Emacs server.
There is an existing Emacs server, named "server".
To start the server in this Emacs process, stop the existing
server or call ‘M-x server-force-delete’ to forcibly disconnect it.*

May you please give me some suggestion?

Emacs version: 26.2

1

You only start one emacs with server start.

To start other editors you don't run emacs you run emacsclient which starts a new process running a new frame (a window in OS terms). emacs client connects to the server and uses all the config and state from the server.

| improve this answer | |
  • Thanks. Seems "server-running-p" is not working on Linux/Mac but working on Windows. Do you have any idea? – kk9527 Aug 3 '19 at 18:43
  • I just do (server-start) or now (use-package server :ensure nil :hook (after-init . server-mode)) – mmmmmm Aug 3 '19 at 18:47
  • Thanks. Not working on Ubuntu 18LTS/Emacs 262. Seems emacsclient is the best way – kk9527 Aug 5 '19 at 4:22

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.