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

From: Jens Schmidt <[email-masked]>
Date: Sat, 15 Mar 2025 19:25:47 +0100

On 2025-03-15  12:50, Eli Zaretskii wrote:

> Would you like submitting a patch with that nit taken care of?

Yes, but please let me clarify another nit first.  With your
proposal we would have error messages like this [comments and
empty lines by me]:

- For the stop-then-restart case:

  [message unchanged comapared to master]

  ⛔ Warning (server): Unable to start the Emacs server.

  [the next line is actually generated from the caught error as `(cadr err)':]
  There is an existing Emacs server, named "server"
  To start the server in this Emacs process, stop the existing server or call M-x server-force-delete to forcibly disconnect it.

- For the stop-only case:

  ⛔ Warning (server): Unable to stop the server.

  [but "your" next line I cannot generate as `(cadr err)':]
  The existing Emacs server, called "server", could not be stopped.
  (Perhaps it was run from a different Emacs session?)
  You can try stopping the server forcibly by calling M-x server-force-delete.

However, I like "your" second line better than the existing one, to be
honest, and it would also fit the existing stop-then-restart case well.

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?

(Sorry for asking, but I still routinely fail to predict your
reaction on my proposals ... :-)

Thanks.