From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.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#40152: 27.0.90; icomplete vs recursive prompts Date: Thu, 19 Aug 2021 23:05:51 +0100 Message-ID: References: <87wo7ex4z6.fsf@gmail.com> <87sgbulznk.fsf@gmail.com> <875z3m74s0.fsf@gmail.com> <87pn1f1xua.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c1c3d205c9f0c1d3" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32048"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40152@debbugs.gnu.org, Stefan Monnier To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 20 00:07:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGqBq-0008Aw-5p for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Aug 2021 00:07:10 +0200 Original-Received: from localhost ([::1]:33850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGqBo-0004se-9E for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Aug 2021 18:07:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGqBj-0004sT-2Z for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 18:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGqBi-0002EU-Pj for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 18:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGqBi-0007dr-FB for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 18:07: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: Thu, 19 Aug 2021 22:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40152 X-GNU-PR-Package: emacs Original-Received: via spool by 40152-submit@debbugs.gnu.org id=B40152.162941077129314 (code B ref 40152); Thu, 19 Aug 2021 22:07:02 +0000 Original-Received: (at 40152) by debbugs.gnu.org; 19 Aug 2021 22:06:11 +0000 Original-Received: from localhost ([127.0.0.1]:60884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGqAt-0007cj-78 for submit@debbugs.gnu.org; Thu, 19 Aug 2021 18:06:11 -0400 Original-Received: from mail-pg1-f169.google.com ([209.85.215.169]:43720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGqAr-0007cX-G2 for 40152@debbugs.gnu.org; Thu, 19 Aug 2021 18:06:09 -0400 Original-Received: by mail-pg1-f169.google.com with SMTP id r2so7214427pgl.10 for <40152@debbugs.gnu.org>; Thu, 19 Aug 2021 15:06:09 -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=d35tBMikaSlY/R8H13D1DavC5ghNfzXnwkafFh+BPqA=; b=cKvv5V8r2bkoViQmwm/E9pnjKdJaAbCiWySMT6cA2rX0LieshcxvJA1aVZ+hUET2nL f3J24ADjFHOM+UaKPQdSwtGE0lX/LLLyUXDnbqExgg/V6VBYjK+C7nN9PG1GL10nyqj5 YqWb5UViziDW2aYFzDg70NsAFQq9ZJeYmBvyxevbVaVMjre47/sUEQlwQxFqVPDgSF0x b04BB9WSrSHz+6pA4MdFZaEpQ5C8IbrGAJZP/Sls4xaUdnQPfnw13D57OWCmst/lJ3vE r/BbUUwH3tmRWvmileETNl0f8UsphuvFHjV/2FUGZUwUVKvUFhdGN7pXA+ahM1a881xO kKlw== 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=d35tBMikaSlY/R8H13D1DavC5ghNfzXnwkafFh+BPqA=; b=rH1AgEwiV0E2h6HOvX/nea7uGrHjxEUpuxDpSezK60EUMNumYmciahhd/q0/5hVtLV p/kzwB20irVoNHkNCjvh6cnEDQCwlzASS7U0ZHUQKZz95ThbhJvag96zWd/zF1jgEUqd Jo/t6ATW4MF4EJpzXGLXDvq10iN+eMP9HAxT3J7f9zSNUIJlxRYDspOSpk2CFgsicCQm FMvg7ehXFps2mYQ8fAVj0ExRPNm8XBx+6q8zsbKXuBkVj2raQlmKW3YDstLfiTmlNIYI 4FrGgzKuMp11koCMQk/G3mBylJ6tc2zUTXknuCQPmzag8dH/erSQNmHQlaAYhZp2Gkuk rLxA== X-Gm-Message-State: AOAM532oST52OPS/NIW5uwhGw8MjAgm8frHHwXX2hvw19u1+fFCklz/2 5/4V2TWtWTXW/x8K62a6HHF0YVuEW46zIsG5g9k= X-Google-Smtp-Source: ABdhPJz+8D2ds9a2uO1OYsJJzxqmBG7lQxYl3iVtWB8JUvyEw3jbzx3aFMzI0RR//oQeumUCM6lvNvrjwzXUqCCYJFc= X-Received: by 2002:a63:c0a:: with SMTP id b10mr15735583pgl.447.1629410763587; Thu, 19 Aug 2021 15:06:03 -0700 (PDT) In-Reply-To: <87pn1f1xua.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212240 Archived-At: --000000000000c1c3d205c9f0c1d3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry K=C3=A9vin, for having mostly ignored this back in February somehow. = I'm back on the icomplete subject for a while, maybe I'll can look at this. I think I understand the problem from you clear recipes. Jo=C3=A3o On Thu, Feb 4, 2021, 19:20 K=C3=A9vin Le Gouguec wrote: > OK, I think I have a simpler reproducer. > > From emacs -Q: > > #+begin_src elisp > (icomplete-mode) > (setq enable-recursive-minibuffers t) > (completing-read > "Prompt #1? " > (lambda (&rest _args) > (read-string "Prompt #2? ") > (list "foo" "bar" "baz"))) > #+end_src > > Current result: > 1. prompt #1 appears, > 2. I type in a letter, say "x", > 3. prompt #2 immediately appears, hijacking prompt #1, > 4. I type in another letter, say "y", > 5. prompt #1 returns, hijacking prompt #2; the "x" I typed is there, > 6. I type in another letter, say "z", > 7. prompt #2 returns, hijacking prompt #1; the "y" I typed is not there. > > Expected result: > 1. prompt #1 appears, > 2. I type in a letter, say "x", > 3. prompt #2 immediately appears, hijacking prompt #1, > 4. I type in another letter, say "y", > 5. *PROMPT #2 REMAINS* until I hit RET/C-j/C-g=E2=80=A6 > 6. prompt #1 returns; the "x" I typed is there. > > (If icomplete-show-matches-on-no-input is set, I guess I'd expect Emacs > to go straight to step 3, with prompt #1 empty on step 6.) > > To summarize my previous messages: > > - In addition to this synthetic recipe, I have two fairly annoying > reproducers: > > 1. xref-find-definitions bounces back between the identifier prompt > and the TAGS table prompt (when there are no tags at point and > xref falls back to the etags backend). > > 2. TRAMP bounces back between the filename prompt and the > .authinfo.gpg passphrase prompt. > > - Even after hours of debugging, I still feel out of my depth with the > completion code; I'd really appreciate some help. I don't mind > debugging some more, but at this point I'd need a clue where to look. > > (Since I feel like my synthetic reproducer is small enough, I'm boldly > CC'ing folks I imagine to be the most familiar with the completion > framework and/or icomplete; I apologize for the forwardness.) > > > > --000000000000c1c3d205c9f0c1d3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry K=C3=A9vin, for having mostly ignored this bac= k in February somehow. I'm back on the icomplete subject for a while, m= aybe I'll can look at this. I think I understand the problem from you c= lear recipes.

Jo=C3=A3o<= br>
On Thu, Feb 4, 2021, 19:20 K=C3=A9vin Le Gouguec <kevin.legouguec@gmail.com> wrote:
OK, I think I have a simpler reprodu= cer.

>From emacs -Q:

#+begin_src elisp
(icomplete-mode)
(setq enable-recursive-minibuffers t)
(completing-read
=C2=A0"Prompt #1? "
=C2=A0(lambda (&rest _args)
=C2=A0 =C2=A0(read-string "Prompt #2? ")
=C2=A0 =C2=A0(list "foo" "bar" "baz")))
#+end_src

Current result:
1. prompt #1 appears,
2. I type in a letter, say "x",
3. prompt #2 immediately appears, hijacking prompt #1,
4. I type in another letter, say "y",
5. prompt #1 returns, hijacking prompt #2; the "x" I typed is the= re,
6. I type in another letter, say "z",
7. prompt #2 returns, hijacking prompt #1; the "y" I typed is not= there.

Expected result:
1. prompt #1 appears,
2. I type in a letter, say "x",
3. prompt #2 immediately appears, hijacking prompt #1,
4. I type in another letter, say "y",
5. *PROMPT #2 REMAINS* until I hit RET/C-j/C-g=E2=80=A6
6. prompt #1 returns; the "x" I typed is there.

(If icomplete-show-matches-on-no-input is set, I guess I'd expect Emacs=
to go straight to step 3, with prompt #1 empty on step 6.)

To summarize my previous messages:

- In addition to this synthetic recipe, I have two fairly annoying
=C2=A0 reproducers:

=C2=A0 =C2=A0 1. xref-find-definitions bounces back between the identifier = prompt
=C2=A0 =C2=A0 =C2=A0 =C2=A0and the TAGS table prompt (when there are no tag= s at point and
=C2=A0 =C2=A0 =C2=A0 =C2=A0xref falls back to the etags backend).

=C2=A0 =C2=A0 2. TRAMP bounces back between the filename prompt and the
=C2=A0 =C2=A0 =C2=A0 =C2=A0.authinfo.gpg passphrase prompt.

- Even after hours of debugging, I still feel out of my depth with the
=C2=A0 completion code; I'd really appreciate some help.=C2=A0 I don= 9;t mind
=C2=A0 debugging some more, but at this point I'd need a clue where to = look.

(Since I feel like my synthetic reproducer is small enough, I'm boldly<= br> CC'ing folks I imagine to be the most familiar with the completion
framework and/or icomplete; I apologize for the forwardness.)



--000000000000c1c3d205c9f0c1d3--