[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: Eli Zaretskii
Subject: Re: [RFC] Option to kill `emacs --daemon' when closing the last client frame
Date: Thu, 21 Oct 2021 10:34:00 +0300

> Cc: emacs-devel@gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
> Date: Wed, 20 Oct 2021 20:43:31 -0700
> > We could add an optional command-line argument to do what you want,
> > but I wonder why would that be useful, when we already have
> > kill-emacs.
> That's one option, although it might take a bit of work to support that 
> (assuming I understand what you mean). As far as I understand how 
> ALTERNATE_EDITOR works, there's not an easy way to automatically start 
> the Emacs daemon *and* provide it with some extra options. That is, 
> ALTERNATE_EDITOR="emacs --daemon --foo" would start the daemon, but 
> wouldn't create a client to connect to it.

We could add a new command to the server-client protocol, and make
emacsclient send this command when invoked with the (hypothetical) new
command-line option.

> Another method might be to add an option like 
> `daemon-kill-when-no-clients' that defaults to nil. Then after an 
> `emacsclient' is killed, we can consult that variable, and if it's true, 
> kill the daemon if there are no remaining clients.

That'd require users to modify their init files, which I think is
slightly less desirable than the alternative with a new protocol

reply via email to

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