[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Option to kill `emacs --daemon' when closing the last client f

From: Jim Porter
Subject: Re: [RFC] Option to kill `emacs --daemon' when closing the last client frame
Date: Mon, 25 Oct 2021 11:06:05 -0700

On 10/24/2021 11:19 PM, Jean Louis wrote:
* Stefan Monnier <monnier@iro.umontreal.ca> [2021-10-22 14:59]:
I guess it would make sense to try and distinguish the two cases:

- Eager: `emacs --daemon` is run (typically from something like a login
   script or systemd) before any emacsclient is involved.
- Lazy: `emacs --daemon` is started on-demand by the `-a` option
   of `emacsclient` (or via ALTERNATE_EDITOR).

In the lazy case, we could kill the daemon when the last client exits.

Can the variable `server-clients' help to detect how many clients are there?

Then if so, one can make Emacs Lisp function and put in
configuration file, then such user can have the Emacs Daemon
killed if last client is closed.

Yup, that's what I'm doing now. I use a slightly-tweaked version of the patch I posted to bug#51377[1] in my configuration. While I'm happy with my configuration now, I wanted to propose adding those changes to Emacs itself (with options to tweak the behavior as appropriate) if others would find it useful.

- Jim

[1] https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg02209.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]