GNU bug report logs - #47205
27.1.91; [bug] unexpected input event interrupted expand-file

Previous Next

Package: emacs;

Reported by: LinSun <lin.sun <at> zoom.us>

Date: Wed, 17 Mar 2021 03:38:02 UTC

Severity: normal

Found in version 27.1.91

Fixed in version 28.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47205 in the body.
You can then email your comments to 47205 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Wed, 17 Mar 2021 03:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to LinSun <lin.sun <at> zoom.us>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 17 Mar 2021 03:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: LinSun <lin.sun <at> zoom.us>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 27.1.91; [bug] unexpected input event interrupted expand-file
Date: Wed, 17 Mar 2021 11:36:47 +0800
[Message part 1 (text/html, inline)]
[backtrace-unexpected-input-event-for-expand-file-name (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Wed, 17 Mar 2021 11:52:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: LinSun via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs <at> gnu.org>
Cc: 47205 <at> debbugs.gnu.org, LinSun <lin.sun <at> zoom.us>
Subject: Re: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Wed, 17 Mar 2021 12:51:23 +0100
LinSun via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

Hi,

> There is a bug that `helm-projectile-find-file' is interrupted by an
> unexpected input event. After inspecting emacs code, I found it can
> simply reproduce by follow code, and the expected out is a path,
> while actually result is t:
>
> emacs --batch --eval "(message \"%s\" (catch 'input
> (let ((throw-on-input 'input)) (expand-file-name \"a.iso/b\"
> \"/\"))))"
>
> From the backtrace, it seems caused by `tramp-archive-file-name-handler’.
>
> How to avoid input event in this situation? Thanks

This input event is expected. You expand the file name "a.iso/b", which
is recognized as archive due to the ".iso/" extension. This triggers the
Tramp archive file name handler, which is implemented using D-Bus. The
input event is a D-Bus event, as you can see:

--8<---------------cut here---------------start------------->8---
# emacs --batch --eval "(message \"%s %s\" (catch 'input (let ((throw-on-input 'input)) (expand-file-name \"a.iso/b\" \"/\"))) last-input-event)"

=> t (dbus-event :system 2 2 org.freedesktop.DBus :1.527417 nil nil nil dbus-call-method-handler)
--8<---------------cut here---------------end--------------->8---

Which problem do you have with D-Bus events?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Wed, 17 Mar 2021 11:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Wed, 17 Mar 2021 15:46:01 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lin Sun <lin.sun <at> zoom.us>
To: Michael Albinus <michael.albinus <at> gmx.de>, 
 "LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors"
 <bug-gnu-emacs <at> gnu.org>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>
Subject: RE: Re: bug#47205: 27.1.91; [bug] unexpected input event
 interrupted expand-file
Date: Wed, 17 Mar 2021 23:45:01 +0800
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Wed, 17 Mar 2021 15:46:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Wed, 17 Mar 2021 17:42:02 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Lin Sun <lin.sun <at> zoom.us>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>,
 "LinSun via Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs <at> gnu.org>
Subject: Re: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Wed, 17 Mar 2021 18:41:35 +0100
Lin Sun <lin.sun <at> zoom.us> writes:

> Hi Michael,

Hi

> It seems only “keyboard” input should trigger a ‘input event, so dbus
> event should be silence for this case.

D-Bus events are implemented as special event, which is also an input
event. `throw-on-input' reacts on input events, perhaps its docstring
shall be adapted.

Again, which problem have you encountered? Or is it just the docstring?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Wed, 17 Mar 2021 17:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 00:28:01 GMT) Full text and rfc822 format available.

Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: LinSun <lin.sun <at> zoom.us>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>,
 "LinSun via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: RE: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 08:27:19 +0800
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 00:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 03:43:02 GMT) Full text and rfc822 format available.

Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):

From: LinSun <lin.sun <at> zoom.us>
To: Michael Albinus <michael.albinus <at> gmx.de>, 
 "sunlin7 <at> yahoo.com" <sunlin7 <at> yahoo.com>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>,
 "LinSun via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: RE: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 11:42:07 +0800
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 03:43:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 04:32:02 GMT) Full text and rfc822 format available.

Message #38 received at submit <at> debbugs.gnu.org (full text, mbox):

From: LinSun <lin.sun <at> zoom.us>
To: Michael Albinus <michael.albinus <at> gmx.de>, 
 "sunlin7 <at> yahoo.com" <sunlin7 <at> yahoo.com>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>,
 "LinSun via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: RE: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 12:31:11 +0800
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 04:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 08:22:02 GMT) Full text and rfc822 format available.

Message #44 received at 47205 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: LinSun <lin.sun <at> zoom.us>
Cc: 47205 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Subject: Re: bug#47205: 27.1.91;
 [bug] unexpected input event interrupted expand-file
Date: Thu, 18 Mar 2021 10:21:40 +0200
> Cc: 47205 <at> debbugs.gnu.org
> Date: Thu, 18 Mar 2021 08:27:19 +0800
> From:  LinSun via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> > which problem have you encountered? Or is it just the docstring?
> 
> It’s from the issue https://github.com/bbatsov/helm-projectile/issues/154, 
> 
> “[bug] `helm-projectile-find-file' empty candidate when there is "*.iso/" folder”
> 
> Through the traceback I attached in first mail, the dbus event cause a unexpected return value in line 
> 
> https://github.com/emacs-helm/helm/blob/26d4e9e4d38a143d7dfb2fe206eacbc326944532/helm.el#L4649,
> 
> Then it’s function will show nothing.

Is this because helm uses while-no-input or throw-on-input?  If so,
does it help to bind while-no-input-ignore-events to a list that
includes this kind of dbus events?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 10:04:02 GMT) Full text and rfc822 format available.

Message #47 received at 47205 <at> debbugs.gnu.org (full text, mbox):

From: LinSun <lin.sun <at> zoom.us>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>,
 "sunlin7 <at> yahoo.com" <sunlin7 <at> yahoo.com>,
 "michael.albinus <at> gmx.de" <michael.albinus <at> gmx.de>
Subject: RE: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 18:02:42 +0800
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 10:08:01 GMT) Full text and rfc822 format available.

Message #50 received at 47205 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47205 <at> debbugs.gnu.org, LinSun <lin.sun <at> zoom.us>
Subject: Re: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 11:07:39 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> It’s from the issue https://github.com/bbatsov/helm-projectile/issues/154, 
>> 
>> “[bug] `helm-projectile-find-file' empty candidate when there is "*.iso/" folder”
>> 
>> Through the traceback I attached in first mail, the dbus event cause a unexpected return value in line 
>> 
>> https://github.com/emacs-helm/helm/blob/26d4e9e4d38a143d7dfb2fe206eacbc326944532/helm.el#L4649,
>> 
>> Then it’s function will show nothing.
>
> Is this because helm uses while-no-input or throw-on-input?  If so,
> does it help to bind while-no-input-ignore-events to a list that
> includes this kind of dbus events?

This doesn't help (yet), because dbus-event isn't handled via
while-no-input-ignore-events. The appended patch extends this for
dbus-event and file-notify. The following adapted test works then:

--8<---------------cut here---------------start------------->8---
# emacs --batch --eval "(message \"%s\" (catch 'input (let ((while-no-input-ignore-events (cons 'dbus-event while-no-input-ignore-events)) (throw-on-input 'input)) (expand-file-name \"a.iso/b\" \"/\"))))"
--8<---------------cut here---------------end--------------->8---

Is it OK to push this to the master branch (plus doc adaptions)?

Best regards, Michael.

[Message part 2 (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 10:14:02 GMT) Full text and rfc822 format available.

Message #53 received at 47205 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: LinSun <lin.sun <at> zoom.us>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>,
 Eli Zaretskii <eliz <at> gnu.org>, "sunlin7 <at> yahoo.com" <sunlin7 <at> yahoo.com>
Subject: Re: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 11:13:28 +0100
LinSun <lin.sun <at> zoom.us> writes:

> Hi Eli,

Hi,

> No effect after add the dbus-event into ` while-no-input-ignore-events
> `, output still be t.

Yes, I've just explained the situation the other message. If Eli agrees,
we'll improve it in the master branch.

> The work around is execute “(require ‘trampe-archive)” before eval the
> statement, output is expanded path:

In your use case, the workaround is much more simple: set
tramp-archive-enabled to nil:

--8<---------------cut here---------------start------------->8---
# emacs --batch --eval "(setq tramp-archive-enabled nil)" --eval "(message \"%s %s\" (catch 'input (let ((throw-on-input 'input)) (expand-file-name \"a.iso/b\" \"/\"))) last-input-event)"
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 10:19:01 GMT) Full text and rfc822 format available.

Message #56 received at 47205 <at> debbugs.gnu.org (full text, mbox):

From: LinSun <lin.sun <at> zoom.us>
To: Michael Albinus <michael.albinus <at> gmx.de>, Eli Zaretskii <eliz <at> gnu.org>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>
Subject: RE: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 18:18:37 +0800
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 10:22:01 GMT) Full text and rfc822 format available.

Message #59 received at 47205 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 47205 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 12:21:23 +0200
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: LinSun <lin.sun <at> zoom.us>,  47205 <at> debbugs.gnu.org
> Date: Thu, 18 Mar 2021 11:07:39 +0100
> 
> > Is this because helm uses while-no-input or throw-on-input?  If so,
> > does it help to bind while-no-input-ignore-events to a list that
> > includes this kind of dbus events?
> 
> This doesn't help (yet), because dbus-event isn't handled via
> while-no-input-ignore-events. The appended patch extends this for
> dbus-event and file-notify. The following adapted test works then:

That patch is fine by me, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 10:22:02 GMT) Full text and rfc822 format available.

Message #62 received at 47205 <at> debbugs.gnu.org (full text, mbox):

From: LinSun <lin.sun <at> zoom.us>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: "47205 <at> debbugs.gnu.org" <47205 <at> debbugs.gnu.org>,
 Eli Zaretskii <eliz <at> gnu.org>, "sunlin7 <at> yahoo.com" <sunlin7 <at> yahoo.com>
Subject: RE: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 18:21:35 +0800
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47205; Package emacs. (Thu, 18 Mar 2021 10:28:02 GMT) Full text and rfc822 format available.

Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Thu, 18 Mar 2021 11:46:02 GMT) Full text and rfc822 format available.

Notification sent to LinSun <lin.sun <at> zoom.us>:
bug acknowledged by developer. (Thu, 18 Mar 2021 11:46:02 GMT) Full text and rfc822 format available.

Message #70 received at 47205-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47205-done <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#47205: 27.1.91; [bug] unexpected input event interrupted
 expand-file
Date: Thu, 18 Mar 2021 12:45:33 +0100
Version: 28.1

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

Hi Eli,

>> > Is this because helm uses while-no-input or throw-on-input?  If so,
>> > does it help to bind while-no-input-ignore-events to a list that
>> > includes this kind of dbus events?
>>
>> This doesn't help (yet), because dbus-event isn't handled via
>> while-no-input-ignore-events. The appended patch extends this for
>> dbus-event and file-notify. The following adapted test works then:
>
> That patch is fine by me, thanks.

Pushed to master, and closing the bug.

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 16 Apr 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 36 days ago.

Previous Next


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