From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#38024: 27.0.50; icomplete sometimes fails to show completions after backward-killing words Date: Fri, 1 Nov 2019 23:28:30 +0000 Message-ID: References: <874kznwa11.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000933d330596515378" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="98471"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38024@debbugs.gnu.org, monnier@iro.umontreal.ca To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 02 00:29:22 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iQgM4-000PT7-Cm for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Nov 2019 00:29:20 +0100 Original-Received: from localhost ([::1]:43884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQgM3-0006HX-16 for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Nov 2019 19:29:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54997) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQgLo-0006HO-8U for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2019 19:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQgLm-0006AY-EY for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2019 19:29:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48723) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQgLm-00069A-AC for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2019 19:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iQgLm-0000AO-3r for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2019 19:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Nov 2019 23:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38024 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.1572650931615 (code B ref -1); Fri, 01 Nov 2019 23:29:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Nov 2019 23:28:51 +0000 Original-Received: from localhost ([127.0.0.1]:57544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQgLb-00009r-4l for submit@debbugs.gnu.org; Fri, 01 Nov 2019 19:28:51 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQgLY-00009j-Ul for submit@debbugs.gnu.org; Fri, 01 Nov 2019 19:28:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54588) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQgLW-0006Gl-Jr for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2019 19:28:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQgLU-0005c8-6I for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2019 19:28:46 -0400 Original-Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]:45360) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQgLT-0005Yn-Tr for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2019 19:28:44 -0400 Original-Received: by mail-io1-xd41.google.com with SMTP id s17so12564769iol.12 for ; Fri, 01 Nov 2019 16:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wLZW51ZyvT64ubgu+xFbnOHNHO0cvkjyFMMsaVcJhCU=; b=nq0xB9cOkSiqQo8+V55/Vybme9eLu35PC0p9ptkqwlyayHUJZ7Mtkxi4cpzh6qI40y rJb0QODrc5qDbLkaWf0deKHB7o0PVdoEEKgCxClFA0gvPxlAuGllZwAai6zDxmO0xkPX ZrqoR3ojnQXXIYB/gN50/zzq3W9NNueZ5nP26WembInNT8c8quX7ozXyAy3jwVxdQ43N RXzDZ5QAwjd9abJO3DW+EahynT1uhJG68fXBE7nBuX9LRiZu7Yr/ZSx7EgtiezcLL/1l BE/686D3xfaOYGsA3paPW5lVmRjqQbkceBc+d8mLDL6U8Gj+ECUtfOqmhGYoc3/wAQ9b v4cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wLZW51ZyvT64ubgu+xFbnOHNHO0cvkjyFMMsaVcJhCU=; b=qXgx3OUagdbBQuirenqxUW6c8o1q8geUFBGo+kuoCekXHdgjcFKBjf0GdblTHom1+9 F8P4USvQymfpkME1TZZwEMPt8kGl5Yuzac27m1GixZYpwM5hwJfWHzJhNfA8x8XNsPcR kF5l+FZDJpfT+X4EWAaWq4rJLm/wSeQgAUK/cwDDiW6l67rlynSVlURx5OZsBkx6YKP7 u9w2wpo3G8Hl2pbv5s6DfV8tpazz9v6X5CcnH/2K4Ty7jLJ7XIWRHdsMG99fjk+6A34r FZXbNKRfRrT7tA7K6mIpUXKI5PWZHDGpSMVhNpOEy1FtvDQTw4vcfN4AJz+dMkG3ewuu l6yw== X-Gm-Message-State: APjAAAUA7ShroOzAuZWra1627PYKy8httBxCoeKAnaTpCQ8ntH9A5Lsq LvyQViMEWf7M2sIyOYaJ0DS6Uv6JoD1UVFUiAvo= X-Google-Smtp-Source: APXvYqytn8lB/blE+SMdOmICa2xLfmPmEClVyCt/LWIykbEGq0bZw+ASF4hO++2UOnKsIujFmx6+1puSiBjEiinRhJg= X-Received: by 2002:a6b:ea0b:: with SMTP id m11mr12170055ioc.97.1572650922227; Fri, 01 Nov 2019 16:28:42 -0700 (PDT) In-Reply-To: <874kznwa11.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170712 Archived-At: --000000000000933d330596515378 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Kevin, you're on the right track. The redisplay thing is not the right fix, indeed. Stefan has a fix for this, which he sent me, but I can't find it now. Anyway, it has to do with avoiding the 'select' event in while-no-input. In case you want to try that before Stefan drops by. Jo=C3=A3o On Fri, Nov 1, 2019, 21:40 K=C3=A9vin Le Gouguec wrote: > Hello, > > tl;dr unless I'm mistaken, sometimes `while-no-input' returns t despite > no input having arrived; this prevents `icomplete-exhibit' from > displaying completion candidates. > > In more details: > > This is a bit of a heisenbug; hopefully someone out there will know what > knobs to tweak to find more information about this. > > From emacs -Q: > > M-x icomplete-mode RET > ;; Find a way to set `default-directory' to some long-ish path, > ;; e.g. with: > M-x find-library RET icomplete RET > C-x C-f > ;; icomplete should show a bunch of completions. > M-DEL > M-DEL > =E2=80=A6 > > After each `backward-kill-word', icomplete usually displays new > completion candidates with no further user input; sometimes however, no > candidates show up until the user does something (e.g. press TAB or > start typing). > > Commit 5860fd3 (Make icomplete-exhibit actually work when navigating up > directories) tried to fix this, but AFAICT it merely reduces the odds of > the bug happening: I can still reproduce it, although less often. Also, > this new call to `redisplay' causes some noticeable flickering when > typing characters: the completions blink in and out as I fill in the > prompt. > > I've tinkered with icomplete.el (commenting out the call to `redisplay' > since it makes the bug harder to trigger); the closest I got to > pin-pointing the cause for this issue was while goofing around in > `icomplete-exhibit', specifically with the `while-no-input' part: > > (let* (=E2=80=A6 > (text (while-no-input > (icomplete-completions > =E2=80=A6))) > =E2=80=A6) > ;; Do nothing if while-no-input was aborted. > (when (stringp text) > update overlay=E2=80=A6)) > > I replaced (when (stringp text) =E2=80=A6) with (if (stringp text) (progn= =E2=80=A6) > (message "text is %s" text)): it seems that text is t when icomplete > fails to show updated candidates, which according to `while-no-input' > means that some input arrived=E2=80=A6 > > However, when I tried to debug `while-no-input', I got stumped: I tried > to do some more printf-debugging[1], but all I observe is that > sometimes, the code seems to be interrupted between > > (let ((throw-on-input ',catch-sym) > val) > and > (setq val (or (input-pending-p) > (progn ,@body))) > > I tried to find where exactly the code gets interrupted, but I could not > get a consistent answer; sometimes it seems to be before executing body, > sometimes it seems to be somewhere inside `icomplete-completions'=E2=80= =A6 > > What would be the best way to investigate this further? > > Thank you for your time. > > > [1] With this patch: > > > When the bug happens, I get the following messages: > > after with-local-quit > after catch and let > text is t > > > PS: It just occured to me that I should search debbugs for > "while-no-input" in addition to "icomplete". I just did that; > bug#15042 looks like it could maybe be related? > > > In GNU Emacs 27.0.50 (build 6, i686-pc-linux-gnu, GTK+ Version 3.24.5, > cairo version 1.16.0) > of 2019-10-21 built on little-buster > Repository revision: 61fb5214816ef3d57e676d900e499ffcd079a1f9 > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.1200400= 0 > System Description: Debian GNU/Linux 10 (buster) > > Configured using: > 'configure --with-xwidgets --with-cairo' > > Configured features: > XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY > INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF > ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS > LIBSYSTEMD JSON PDUMPER LCMS2 GMP > > Important settings: > value of $LANG: en_US.UTF-8 > locale-coding-system: utf-8-unix > --000000000000933d330596515378 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Kevin, you're on the right track. The redisplay thing= is not the right fix, indeed. Stefan has a fix for this, which he sent me,= but I can't find it now.

= Anyway, it has to do with avoiding the 'select' event in while-no-i= nput.=C2=A0

In case you = want to try that before Stefan drops by.

<= div dir=3D"auto">Jo=C3=A3o

On Fri, Nov 1, 2019, 21:40 K=C3=A9vin Le Go= uguec <kevin.legouguec@gmail.com> wrote:
Hello,

tl;dr unless I'm mistaken, sometimes `while-no-input' returns t des= pite
no input having arrived; this prevents `icomplete-exhibit' from
displaying completion candidates.

In more details:

This is a bit of a heisenbug; hopefully someone out there will know what knobs to tweak to find more information about this.

>From emacs -Q:

=C2=A0 =C2=A0 M-x icomplete-mode RET
=C2=A0 =C2=A0 ;; Find a way to set `default-directory' to some long-ish= path,
=C2=A0 =C2=A0 ;; e.g. with:
=C2=A0 =C2=A0 M-x find-library RET icomplete RET
=C2=A0 =C2=A0 C-x C-f
=C2=A0 =C2=A0 ;; icomplete should show a bunch of completions.
=C2=A0 =C2=A0 M-DEL
=C2=A0 =C2=A0 M-DEL
=C2=A0 =C2=A0 =E2=80=A6

After each `backward-kill-word', icomplete usually displays new
completion candidates with no further user input; sometimes however, no
candidates show up until the user does something (e.g. press TAB or
start typing).

Commit 5860fd3 (Make icomplete-exhibit actually work when navigating up
directories) tried to fix this, but AFAICT it merely reduces the odds of the bug happening: I can still reproduce it, although less often.=C2=A0 Als= o,
this new call to `redisplay' causes some noticeable flickering when
typing characters: the completions blink in and out as I fill in the
prompt.

I've tinkered with icomplete.el (commenting out the call to `redisplay&= #39;
since it makes the bug harder to trigger); the closest I got to
pin-pointing the cause for this issue was while goofing around in
`icomplete-exhibit', specifically with the `while-no-input' part:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let* (=E2=80=A6
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(text (while-= no-input
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(icomplete-completions
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =E2=80=A6)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=E2=80=A6) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Do nothing if while-no-input w= as aborted.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (stringp text)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 update overlay=E2=80=A6))<= br>
I replaced (when (stringp text) =E2=80=A6) with (if (stringp text) (progn = =E2=80=A6)
(message "text is %s" text)): it seems that text is t when icompl= ete
fails to show updated candidates, which according to `while-no-input' means that some input arrived=E2=80=A6

However, when I tried to debug `while-no-input', I got stumped: I tried=
to do some more printf-debugging[1], but all I observe is that
sometimes, the code seems to be interrupted between

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((throw-on-input ',catch-sym) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0val)
and
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq val (or (input-pending-p) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(progn ,@body)))

I tried to find where exactly the code gets interrupted, but I could not get a consistent answer; sometimes it seems to be before executing body, sometimes it seems to be somewhere inside `icomplete-completions'=E2=80= =A6

What would be the best way to investigate this further?

Thank you for your time.


[1] With this patch:


When the bug happens, I get the following messages:

=C2=A0 =C2=A0 after with-local-quit
=C2=A0 =C2=A0 after catch and let
=C2=A0 =C2=A0 text is t


PS: It just occured to me that I should search debbugs for
=C2=A0 =C2=A0 "while-no-input" in addition to "icomplete&quo= t;.=C2=A0 I just did that;
=C2=A0 =C2=A0 bug#15042 looks like it could maybe be related?


In GNU Emacs 27.0.50 (build 6, i686-pc-linux-gnu, GTK+ Version 3.24.5, cair= o version 1.16.0)
=C2=A0of 2019-10-21 built on little-buster
Repository revision: 61fb5214816ef3d57e676d900e499ffcd079a1f9
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.1= 2004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
=C2=A0'configure --with-xwidgets --with-cairo'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER LCMS2 GMP

Important settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-system: utf-8-unix
--000000000000933d330596515378--