all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jim Porter <jporterbugs@gmail.com>
Cc: 59668@debbugs.gnu.org
Subject: bug#59668: 29.0.50; [PATCH] Make 'server-stop-automatically' into a defcustom
Date: Thu, 01 Dec 2022 19:08:07 +0200	[thread overview]
Message-ID: <83mt87gih4.fsf@gnu.org> (raw)
In-Reply-To: <155f479d-3bae-c327-47a3-7b58daf912c0@gmail.com> (message from Jim Porter on Mon, 28 Nov 2022 20:23:17 -0800)

> Date: Mon, 28 Nov 2022 20:23:17 -0800
> From: Jim Porter <jporterbugs@gmail.com>
> 
>    The Emacs server can optionally be stopped automatically when
>    certain conditions are met.  To do this, call the function
>    @code{server-stop-automatically} in your init file (@pxref{Init
>    File}), with one of the following arguments...
> 
> It'd be nice if this were a defcustom so that people who prefer the 
> Customize interface could use that instead of editing their init files. 
> Here's a patch for that.

Thanks.

> One question though: should this only go on the master branch, or should 
> it go into the 29 branch? To me, it seems like it could go either way, 
> though I think it'd be nice to make this easier for users in 29. I'll do 
> whatever the maintainers think is best though.

Let's not start installing new features on the release branch.  We have
enough new stuff there already.  Besides, the changes you suggest are hardly
trivial, and saying just "make a function into a defcustom" doesn't come
close to describing it, IMO.

So please install on master, once you take care of the comments below.

> If it goes on the master branch only, I'll add back the function form of 
> 'server-stop-automatically' for compatibility, and then mark it obsolete.

I see no reason to make the function obsolete.  It does not harm to have
both a variable and a function by the same name.

> -@findex server-stop-automatically
> +@vindex server-stop-automatically
>    The Emacs server can optionally be stopped automatically when
> -certain conditions are met.  To do this, call the function
> -@code{server-stop-automatically} in your init file (@pxref{Init
> -File}), with one of the following arguments:
> +certain conditions are met.  To do this, set the option
> +@code{server-stop-automatically} to one of the following values:
>  
>  @itemize
>  @item
> -With the argument @code{empty}, the server is stopped when it has no
> +With the value @code{empty}, the server is stopped when it has no
>  clients, no unsaved file-visiting buffers and no running processes
>  anymore.
>  
>  @item
> -With the argument @code{delete-frame}, when the last client frame is
> +With the value @code{delete-frame}, when the last client frame is
>  being closed, you are asked whether each unsaved file-visiting buffer
>  must be saved and each unfinished process can be stopped, and if so,
>  the server is stopped.

This @itemize list should be converted to a @table, formatted like this:

  @item empty
  This value caused the server to be stopped when...

  @item delete-frame
  This value means that when the last client frame is deleted...

etc., I guess you get the idea.

> @@ -1780,7 +1784,8 @@ server-save-buffers-kill-terminal
>  
>  If emacsclient was started with a list of filenames to edit, then
>  only these files will be asked to be saved."
> -  (if server-stop-automatically
> +  (if (and (daemonp)
> +           (memq server-stop-automatically '(kill-terminal delete-frame))

Why is this needed?  I guess I don't understand why non-trivial code changes
are in a patch that was supposed to just add a defcustom?

> +(defun server-apply-stop-automatically ()
> +  "Apply the current value of `server-stop-automatically'.
> +This function adds or removes the necessary helpers to manage
> +stopping the Emacs server automatically, depending on the whether
> +the server is running or not.  This function only applies when
> +running Emacs as a daemon."

And why this significant refactoring of the original function? was there
something wrong with it?





  reply	other threads:[~2022-12-01 17:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29  4:23 bug#59668: 29.0.50; [PATCH] Make 'server-stop-automatically' into a defcustom Jim Porter
2022-12-01 17:08 ` Eli Zaretskii [this message]
2022-12-01 18:33   ` Jim Porter
2022-12-01 18:41     ` Jim Porter
2022-12-02  3:30   ` Jim Porter
2022-12-02 14:42     ` Eli Zaretskii
2022-12-07  1:39       ` Jim Porter
2022-12-07  1:49         ` Jim Porter
2022-12-07 12:48         ` Eli Zaretskii
2022-12-08  6:02           ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mt87gih4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59668@debbugs.gnu.org \
    --cc=jporterbugs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.