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

From: Bror Winther <[email-masked]>
Date: Sun, 20 Jul 2025 14:58:06 +0200

Oh. Okay. I understand that this is probably not the best place to discuss
features but having such a delay configurable would be nice. I have created a
small patch. What email should I send it to?

//bror

> On 20 Jul 2025, at 14.02, Eli Zaretskii <[email-masked]> wrote:
> 
>> From: Bror Winther <[email-masked]>
>> Date: Sun, 20 Jul 2025 04:15:53 +0200
>> 
>> After upgrading to 30.1 I have noticed that all my external scripts take
>> very long to finish from time to time. In particular I noticed the line
>> in my window manager script `emacsclient --eval "(evil-window-up 1)`
>> would take a long time to finish if there is no window found. This
>> causes the script to be very slow. I think I have narrowed it down to
>> `signal`.
>> 
>> The time it takes to execute a simple signal seems to be very high.
>> 
>> time emacsclient --eval "(signal 'user-error (list (apply #'format-message \"%s\" '(test))))"
>> *ERROR*: test
>> emacsclient --eval   0.00s user 0.00s system 0% cpu 2.013 total
> 
> This is a feature: the Emacs server waits fore 2 sec after showing an
> error message, to make sure the user has time to see it:
> 
>  (defun server-return-error (proc err)
>    (ignore-errors
>      ;; Display the error as a message and give the user time to see
>      ;; it, in case the error written by emacsclient to stderr is not
>      ;; visible for some reason.
>      (server--message-sit-for 2 (error-message-string err))
>      (server-send-string
>       proc (concat "-error " (server-quote-arg
> 			       (error-message-string err))))