GNU bug report logs - #64866
30.0.50; Emacsclient block for 2 seconds when error is raised from command

Previous Next

Package: emacs;

Reported by: Yikai Zhao <yikai <at> z1k.dev>

Date: Wed, 26 Jul 2023 02:11:01 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yikai Zhao <yikai <at> z1k.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64866 <at> debbugs.gnu.org
Subject: bug#64866: 30.0.50; Emacsclient block for 2 seconds when error is raised from command
Date: Wed, 26 Jul 2023 23:50:43 +0800
Thanks for your reply.

That's OK, I understand your point. Previously I thought this should
be treated as a bug because in my mind, "emacsclient -e xxxx" is
similar to "emacs --eval=xxx" (and further, similar to "python -c
xxxx"), which is a general interface to evaluate code (but maybe in a
specific environment (the server)). In that case, arbitrarily sleeping
some extra seconds in some valid evaluation scenarios seems
unexpected. Now I can see why that's not the case as the primary
function of emacsclient is to "tell a running Emacs to visit a file".


For any others who may be interested, my use case can be workaround by
using a slightly more complex command:

    RES="$(emacsclient -e "(condition-case nil (progn (windmove-right)
t) (error nil))")"
    if [ "$RES" != "t" ]; then
        return 1
    fi


On Wed, Jul 26, 2023 at 10:29 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: Yikai Zhao <yikai <at> z1k.dev>
> > Date: Wed, 26 Jul 2023 10:10:08 +0800
> >
> >
> > After updating to recent master version of emacs, emacsclient would
> > block for an extra 2 seconds when some error is raised from command.
>
> That's deliberate: we want to allow the user to see the error message.
> It is not a bug.
>
> > Why it affects me:
> >
> > I bind some keyboard shortcut globally to a script to move either from
> > emacs window or i3wm window. It does something like this:
> >
> >    emacsclient -e '(windmove-right)' || i3-msg focus right
> >
> > It rely on the behavior that, if I'm currently in the rightmost emacs
> > buffer, '(windmove-right)' would return an error and fallback to use
> > i3-msg to move to another frame. With this bug I mentioned, it would
> > introduce 2-second delay on this action.
>
> I don't think your quite special use case is a reason good enough to
> prevent users from seeing error messages.  An error message that
> cannot be read is useless.
>
> Sorry.




This bug report was last modified 1 year and 351 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.