Subject: Re: bug#76870: 31.0.50; server-start with non-nil arg LEAVE-DEAD can write confusing warnings

From: Eli Zaretskii <[email-masked]>
Date: Sat, 29 Mar 2025 13:45:40 +0300

> Date: Sun, 23 Mar 2025 16:22:08 +0100
> Cc: [email-masked]
> From: Jens Schmidt <[email-masked]>
> 
> On 2025-03-16  08:34, Eli Zaretskii wrote:
> 
> >> So would you mind if I also changed function `server-stop' to always
> >> signal according to your proposal:
> >>
> >>   (signal 'server-running-external
> >>           (list (format "The existing Emacs server, called \"%s\", could not be stopped."
> >>                         server-name))))
> >>
> >> and then use the `(cadr err)' for both cases?
> > 
> > Yes, that'd be good.
> 
> I have attached two versions of the patch: The first
> 
>   0001-Improve-message-handling-on-server-stop.patch
> 
> with the messages we have agreed upon so far:
> 
>  Restart-then-stop:
> 
>   1  ⛔ Warning (server): Unable to start the Emacs server.
>   2  The existing Emacs server, called "server", could not be stopped.
>   3  To start the server in this Emacs process, stop the existing server or call M-x server-force-delete to forcibly disconnect it.
> 
>  Stop-only:
> 
>   4  ⛔ Warning (server): Unable to stop the server.
>   5  The existing Emacs server, called "server", could not be stopped.
>   6  (Perhaps it was run from a different Emacs session?)
>   7  You can try stopping the server forcibly by calling M-x server-force-delete.
> 
> The second one
> 
>   0001-Improve-message-handling-on-server-stop-consistent.patch
> 
> fixes (IMO) two minor inconsistencies ("server" vs. "Emacs server"
> in line 4, "Emacs process" vs. "Emacs session" in line 3):
> 
>  Restart-then-stop:
> 
>    1  ⛔ Warning (server): Unable to start the Emacs server.
>    2  The existing Emacs server, called "server", could not be stopped.
>    3  To start the server in this Emacs session, stop the existing server or call M-x server-force-delete to forcibly disconnect it.
> 
>  Stop-only:
> 
>    4  ⛔ Warning (server): Unable to stop the Emacs server.
>    5  The existing Emacs server, called "server", could not be stopped.
>    6  (Perhaps it was run from a different Emacs session?)
>    7  You can try stopping the server forcibly by calling M-x server-force-delet
> 
> If one of these is OK for you (I'd prefer the second one), please
> go ahead and install them, otherwise please let me know what still
> needs fixing.

Thanks, I installed the second one on the master branch.

Closing.