Fork me on GitHub

Hi guys! Anyone use emacs as daemon on MacOs? I created a launchctl file:

<?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
  <plist version="1.0">
The daemon start correctly. According the log file and the process:
Starting Emacs daemon.
Doom loaded 187 packages across 35 modules

$ ps aux | grep emacs
=> 751   0.0  0.7 409481952 121056   ??  Ss   12:16PM   0:03.64 /opt/homebrew/Cellar/emacs-plus@28/28.1/ --bg-daemon=\0123,4\012
But when I use the emacsclient I get: emacsclient: can't find socket; have you started the server? Any advice?

Benjamin C11:02:04

I presume you already have this somewhere in your config?: (server-start) Not sure if you need that with --bg-daemon, but might be worth a shot.


emacs-plus already comes with one you can start with brew services start (the install tells you about it iirc)

César Olea14:02:05

As @U043RSZ25HQ said if you’re using emacs-plus it already comes with its own service that you can start with brew services start d12frosted/emacs-plus/emacs-plus or if you use a specific branch: brew services start d12frosted/emacs-plus/emacs-plus@28 adjust accordingly. If you still want to use launchctl change --daemon to --fg-daemon and once its running to connect the client run /opt/homebrew/bin/emacsclient -c I currently run it via homebrew, but used to do it through launchctl in the past.


Thanks guys! I will try that.