unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: 40152@debbugs.gnu.org
Cc: "Stefan Monnier" <monnier@iro.umontreal.ca>,
	"João Távora" <joaotavora@gmail.com>
Subject: bug#40152: 27.0.90; icomplete vs recursive prompts
Date: Thu, 04 Feb 2021 19:39:41 +0100	[thread overview]
Message-ID: <87pn1f1xua.fsf@gmail.com> (raw)
In-Reply-To: <875z3m74s0.fsf@gmail.com> ("Kévin Le Gouguec"'s message of "Sun, 24 Jan 2021 16:06:55 +0100")

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…
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.)





  reply	other threads:[~2021-02-04 18:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 18:21 bug#40152: 27.0.90; icomplete vs recursive prompts Kévin Le Gouguec
2020-03-21  7:27 ` Eli Zaretskii
2020-03-21 12:21   ` Kévin Le Gouguec
2020-03-21 13:36     ` Eli Zaretskii
2020-03-21 20:03       ` Kévin Le Gouguec
2020-09-07  9:11 ` Kévin Le Gouguec
2021-01-24 15:06   ` Kévin Le Gouguec
2021-02-04 18:39     ` Kévin Le Gouguec [this message]
2021-08-19 22:05       ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn1f1xua.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=40152@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).