Subject: Re: bug#79058: 30.1; involking signal using emacsclient takes very long time to complete ~2 seconds

From: Eli Zaretskii <[email-masked]>
Date: Wed, 23 Jul 2025 14:10:04 +0300

> From: Bror Winther <[email-masked]>
> Date: Tue, 22 Jul 2025 20:01:36 +0200
> Cc: [email-masked]
> 
> >> How does that work when the client frame is a tty? Not the sense of emacs in the terminal but
> >> using --eval.
> >> I’m asking to understand why we waiting in exactly that scenario is fitting.
> > 
> > Sorry, I don't understand the question.  Even if the client frame is a
> > tty, it is the Emacs server that displays there, not emacsclient.
> > emacsclient doesn't display anything on that frame, it just sends the
> > command to the server.
> 
> Let me see if I understand correctly and thank you for your patience with me.
> I was under the impression that using --eval would not create a client frame
> so your statement confuses me a bit.

No, --eval doesn't disable creation of a client frame.  Try this:

  $ emacsclient -t --eval '(message "foo")'

This creates a client frame on the current terminal, and shows the
message "foo" there.

> I can’t wrap my head around the necessity of the wait in the case of --eval. 
> When you call --eval and encounter an error there is no output in the terminal
> during the wait time. So let me rephrase my question, what are we waiting for?

The expression inside --eval could signal an error.  That error is
shown on the client frame.  If we delete the client frame immediately,
the error message will only be shown on the stderr stream of
emacsclient, and if that is not visible, the user won't have any
opportunity of seeing the message.  So we wait for the user to see the
message on the client frame before we delete it.