ch11ng / exwm

Emacs X Window Manager
2.85k stars 135 forks source link

Correctly stop the subordinate Emacs daemon #939

Closed Stebalien closed 9 months ago

Stebalien commented 9 months ago

This patch starts Emacs as a foreground daemon (so it can accurately be killed) and terminates it by sending a signal (because server-force-delete stops the local server, not the named server).

medranocalvo commented 9 months ago

because server-force-delete stops the local server, not the named server

This sounded like a bug, but might be an API deficiency. Would let-binding server-name allow server-start to work?

(let ((server-name "our EXWM subordinate server name"))
  (server-stop)
Stebalien commented 9 months ago

Unfortunately, no. Emacs stops the server running in the current process regardless of the name and never actually tries to communicate with any remote servers.

medranocalvo commented 9 months ago

I was confused: I thought we started a second server on EXWM's Emacs. No: we start a new Emacs and start the server there. It makes no sense trying to use server-stop.

I'll merge soon.

medranocalvo commented 9 months ago

This has been merged. Thank you.