unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40152: 27.0.90; icomplete vs recursive prompts
@ 2020-03-20 18:21 Kévin Le Gouguec
  2020-03-21  7:27 ` Eli Zaretskii
  2020-09-07  9:11 ` Kévin Le Gouguec
  0 siblings, 2 replies; 9+ messages in thread
From: Kévin Le Gouguec @ 2020-03-20 18:21 UTC (permalink / raw)
  To: 40152

Hello,

There seems to be some interference between icomplete-mode and some
prompting functions such as xref-find-definitions.  From emacs -Q, after
M-x icomplete-mode:

- "Synthetic" reproduction recipe:
    - (completing-read "Foo? " (tags-lazy-completion-table))

- With actual user commands:
    - C-x b foo RET
      - or any non-Lisp buffer, so that xref picks the etags backend
    - M-.

From there:

- Try to input a character.
    - The identifier prompt is interrupted by the etags prompt ("Visit
      tags table").
- Try to input a character.
    - The etags prompt disappears and we're back to the identifier
      prompt.

The identifier prompt is replaced with the etags prompt as soon as a
single character is typed.  While in the etags prompt, one can use
icomplete commands (e.g. TAB, C-.) as well as C-q CHAR to input
characters one-by-one.

This seems to be reproducible as far back as version 25.3 (couldn't get
any 24.x version to compile).

(ISTR another instance of this bug where TRAMP and EPG would fight each
other when using the sudo or sudoedit methods (the former asking for the
root password, the latter for the ~/.authinfo.gpg key), but I can't seem
to reproduce it.)


Let me know if this report needs more details.  Thank you for your time.


In GNU Emacs 28.0.50 (build 9, x86_64-pc-linux-gnu, GTK+ Version 3.24.14, cairo version 1.16.0)
 of 2020-03-18 built on my-little-tumbleweed
Repository revision: 64d9b4cd762cd39749b899343cb4878e5998a170
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12007000
System Description: openSUSE Tumbleweed

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 JSON
PDUMPER LCMS2 GMP

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#40152: 27.0.90; icomplete vs recursive prompts
  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-09-07  9:11 ` Kévin Le Gouguec
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2020-03-21  7:27 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: 40152

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Date: Fri, 20 Mar 2020 19:21:01 +0100
> 
> - "Synthetic" reproduction recipe:
>     - (completing-read "Foo? " (tags-lazy-completion-table))
> 
> - With actual user commands:
>     - C-x b foo RET
>       - or any non-Lisp buffer, so that xref picks the etags backend
>     - M-.
> 
> >From there:
> 
> - Try to input a character.
>     - The identifier prompt is interrupted by the etags prompt ("Visit
>       tags table").
> - Try to input a character.
>     - The etags prompt disappears and we're back to the identifier
>       prompt.
> 
> The identifier prompt is replaced with the etags prompt as soon as a
> single character is typed.  While in the etags prompt, one can use
> icomplete commands (e.g. TAB, C-.) as well as C-q CHAR to input
> characters one-by-one.

What would you like to happen instead?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#40152: 27.0.90; icomplete vs recursive prompts
  2020-03-21  7:27 ` Eli Zaretskii
@ 2020-03-21 12:21   ` Kévin Le Gouguec
  2020-03-21 13:36     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Kévin Le Gouguec @ 2020-03-21 12:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 40152

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
>> Date: Fri, 20 Mar 2020 19:21:01 +0100
>> 
>> - "Synthetic" reproduction recipe:
>>     - (completing-read "Foo? " (tags-lazy-completion-table))
>> 
>> - With actual user commands:
>>     - C-x b foo RET
>>       - or any non-Lisp buffer, so that xref picks the etags backend
>>     - M-.
>> 
>> From there:
>> 
>> - Try to input a character.
>>     - The identifier prompt is interrupted by the etags prompt ("Visit
>>       tags table").
>> - Try to input a character.
>>     - The etags prompt disappears and we're back to the identifier
>>       prompt.
>> 
>> The identifier prompt is replaced with the etags prompt as soon as a
>> single character is typed.  While in the etags prompt, one can use
>> icomplete commands (e.g. TAB, C-.) as well as C-q CHAR to input
>> characters one-by-one.
>
> What would you like to happen instead?

When the etags prompt interrupts the xref prompt, I'd like the etags
prompt to remain uninterrupted until I exit it (with e.g. RET/C-j).  In
particular, self-inserting characters do not cause the xref prompt to
come back.

For example, if I'm in a buffer whose default-directory is the root of
the Emacs source repository (e.g. in a Dired buffer, visiting the
Makefile…) and I hit C-. (and point is not on something that looks like
an identifier), here's what happens:

1. the "Find definitions of" prompt appears,
2. I start typing an identifier,
3. the "Visit tags table" prompt interrupts,
4. I'd like to input "src/ C-j", but every self-inserting character
   makes the prompt go back-and-forth between "Find definitions of" and
   "Visit tags table".  Worse, when the prompt comes back to "Visit tags
   table", any character I had previously input has disappeared.

I just found out that there is a workaround: in step 2, if I hit TAB
(minibuffer-complete) instead of typing an identifier, the "Visit tags
table" prompt comes up *and stays until I exit it*.  The back-and-forth
only starts if

1. I input a self-inserting char during the first prompt, or
2. if icomplete-show-matches-on-no-input is t.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#40152: 27.0.90; icomplete vs recursive prompts
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2020-03-21 13:36 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: 40152

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: 40152@debbugs.gnu.org
> Date: Sat, 21 Mar 2020 13:21:27 +0100
> 
> >> The identifier prompt is replaced with the etags prompt as soon as a
> >> single character is typed.  While in the etags prompt, one can use
> >> icomplete commands (e.g. TAB, C-.) as well as C-q CHAR to input
> >> characters one-by-one.
> >
> > What would you like to happen instead?
> 
> When the etags prompt interrupts the xref prompt, I'd like the etags
> prompt to remain uninterrupted until I exit it (with e.g. RET/C-j).  In
> particular, self-inserting characters do not cause the xref prompt to
> come back.
> 
> For example, if I'm in a buffer whose default-directory is the root of
> the Emacs source repository (e.g. in a Dired buffer, visiting the
> Makefile…) and I hit C-.

You mean, M-., right?

>(and point is not on something that looks like an identifier),

How do you do that?  If I type M-. in *scratch*, Emacs doesn't ask me
whether to visit a tags table (because the major mode is emacs-lisp).
I need to visit a C file in src/ or lib-src/, but then all I need to
type at the prompt is RET, nothing else.  And if I do the above from a
Dired buffer which shows the Emacs's root directory, then I get the
prompt about visiting the tags table without any "Find definitions"
prompt, and the problem doesn't happen.

So please show the exact recipe for how to reproduce the problem you
see.

> here's what happens:
> 
> 1. the "Find definitions of" prompt appears,
> 2. I start typing an identifier,
> 3. the "Visit tags table" prompt interrupts,
> 4. I'd like to input "src/ C-j", but every self-inserting character
>    makes the prompt go back-and-forth between "Find definitions of" and
>    "Visit tags table".  Worse, when the prompt comes back to "Visit tags
>    table", any character I had previously input has disappeared.

So the problem happens _after_ the prompt, not _with_ the prompt.
That wasn't quite clear, at least to me, from your original report:
there was no sign in it what was the actual problem and what was the
expected and result.  Now I think it's becoming clearer, thanks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#40152: 27.0.90; icomplete vs recursive prompts
  2020-03-21 13:36     ` Eli Zaretskii
@ 2020-03-21 20:03       ` Kévin Le Gouguec
  0 siblings, 0 replies; 9+ messages in thread
From: Kévin Le Gouguec @ 2020-03-21 20:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 40152

Eli Zaretskii <eliz@gnu.org> writes:

>> For example, if I'm in a buffer whose default-directory is the root of
>> the Emacs source repository (e.g. in a Dired buffer, visiting the
>> Makefile…) and I hit C-.
>
> You mean, M-., right?

Right 🤦.

>>(and point is not on something that looks like an identifier),
>
> How do you do that?  If I type M-. in *scratch*, Emacs doesn't ask me
> whether to visit a tags table (because the major mode is emacs-lisp).
> I need to visit a C file in src/ or lib-src/, but then all I need to
> type at the prompt is RET, nothing else.  And if I do the above from a
> Dired buffer which shows the Emacs's root directory, then I get the
> prompt about visiting the tags table without any "Find definitions"
> prompt, and the problem doesn't happen.
>
> So please show the exact recipe for how to reproduce the problem you
> see.
>
>> here's what happens:
>> 
>> 1. the "Find definitions of" prompt appears,
>> 2. I start typing an identifier,
>> 3. the "Visit tags table" prompt interrupts,
>> 4. I'd like to input "src/ C-j", but every self-inserting character
>>    makes the prompt go back-and-forth between "Find definitions of" and
>>    "Visit tags table".  Worse, when the prompt comes back to "Visit tags
>>    table", any character I had previously input has disappeared.
>
> So the problem happens _after_ the prompt, not _with_ the prompt.
> That wasn't quite clear, at least to me, from your original report:
> there was no sign in it what was the actual problem and what was the
> expected and result.  Now I think it's becoming clearer, thanks.

My apologies for being unclear.  Do those 4 steps you quoted (preceded
by M-x icomplete-mode) demonstrate the problem well enough then, or is
there anything I should add?

To recap:

- The problem only happens
    - with icomplete-mode,
    - with the etags backend,
    - when there is no "identifier-like" symbol under point,
    - when either
        - the user starts typing self-inserting characters when the xref
          identifier prompt shows up, or
        - icomplete-show-matches-on-no-input is t.

- The problem is that one cannot fill in the tags table prompt easily:
  self-inserting characters cause the minibuffer to move back-and-forth
  between the tags table prompt and the xref identifier prompt.

  The tags table prompt interrupting the xref prompt is not an issue (to
  me, at least); what I would like is being able to complete the tags
  table prompt, then go back to the xref prompt.

- A workaround consists in calling minibuffer-complete (TAB) immediately
  when the xref prompt shows up; this brings up a functional tags table
  prompt.
  (This workaround cannot work when icomplete-show-matches-on-no-input
  is t.)

Let me know if I managed to muddy things up further.

Thank you for your patience.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#40152: 27.0.90; icomplete vs recursive prompts
  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-09-07  9:11 ` Kévin Le Gouguec
  2021-01-24 15:06   ` Kévin Le Gouguec
  1 sibling, 1 reply; 9+ messages in thread
From: Kévin Le Gouguec @ 2020-09-07  9:11 UTC (permalink / raw)
  To: 40152

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> (ISTR another instance of this bug where TRAMP and EPG would fight each
> other when using the sudo or sudoedit methods (the former asking for the
> root password, the latter for the ~/.authinfo.gpg key), but I can't seem
> to reproduce it.)

Found a recipe, with the SSH method:

1. create an ~/.authinfo.gpg file with the EasyPG assistant[1]
2. pkill -HUP gpg-agent
2. emacs -Q
3. (progn
     (setq epg-pinentry-mode 'loopback)
     (icomplete-mode))
5. C-x C-f /ssh:

This brings up epa.el's "Passphrase for symmetric encryption" prompt to
unlock ~/.authinfo.gpg.  The prompt cannot be completed, because any
self-inserting character brings the "Find file" prompt back up, and from
*there*, typing any character brings the "Passphrase for symmetric
encryption" prompt back again.

I don't mind icomplete proactively trying to open authinfo.gpg to
find candidates for hostnames[2]; unfortunately as things stand I have
to hit C-g a bunch, disable icomplete, do whatever I was trying to do,
then enable icomplete back.


[1] I.e. visit ~/.authinfo.gpg, and save it with a password when
    prompted.  The content doesn't matter, but it has to be properly
    encrypted, otherwise GPG will recognize the file is malformed and
    abort before EPA can prompt for a password.

[2] Or a TAGS file to find candidates for identifiers, as seen in the
    initial report.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#40152: 27.0.90; icomplete vs recursive prompts
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Kévin Le Gouguec @ 2021-01-24 15:06 UTC (permalink / raw)
  To: 40152

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> 1. create an ~/.authinfo.gpg file with the EasyPG assistant[1]
> 2. pkill -HUP gpg-agent
> 2. emacs -Q
> 3. (progn
>      (setq epg-pinentry-mode 'loopback)
>      (icomplete-mode))
> 5. C-x C-f /ssh:
>
> This brings up epa.el's "Passphrase for symmetric encryption" prompt to
> unlock ~/.authinfo.gpg.  The prompt cannot be completed, because any
> self-inserting character brings the "Find file" prompt back up, and from
> *there*, typing any character brings the "Passphrase for symmetric
> encryption" prompt back again.

Still getting bitten by this, just about every time I start Emacs and
open a remote file.

I've tried to debug this repeatedly, but I'm obviously doing it wrong
since no amount of debugging-on-entry or tweaking
{pre,post}-command-hook amounted to anything.

FWIW I've dumped backtraces of both the TRAMP recipe and the etags
recipe.


[-- Attachment #2: tramp --]
[-- Type: text/plain, Size: 3109 bytes --]

Debugger entered--entering a function:
* read-file-name("Visit tags table (default TAGS): " "/usr/local/share/emacs/28.0.50/lisp/" "TAGS" t)
  visit-tags-table-buffer()
  #f(compiled-function (string pred action) #<bytecode -0x44eaa5b86f00cea>)("f" nil metadata)
  completion-metadata("f" #f(compiled-function (string pred action) #<bytecode -0x44eaa5b86f00cea>) nil)
  completion--field-metadata(22)
  icomplete-completions("f" #f(compiled-function (string pred action) #<bytecode -0x44eaa5b86f00cea>) nil nil)
  icomplete-exhibit()
  (let ((non-essential t)) (icomplete-exhibit))
  icomplete-post-command-hook()
  read-from-minibuffer("Find definitions of: " nil (keymap (menu-bar keymap (minibuf "Minibuf" keymap (tab menu-item "Complete" minibuffer-complete :help "Complete as far as possible") (space menu-item "Complete Word" minibuffer-complete-word :help "Complete at most one word") (63 menu-item "List Completions" minibuffer-completion-help :help "Display all possible completions") "Minibuf")) (27 keymap (118 . switch-to-completions)) (prior . switch-to-completions) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . minibuffer-complete) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil xref--read-identifier-history nil nil)
  completing-read-default("Find definitions of: " #f(compiled-function (string pred action) #<bytecode -0x44eaa5b86f00cea>) nil nil nil xref--read-identifier-history nil nil)
  completing-read("Find definitions of: " #f(compiled-function (string pred action) #<bytecode -0x44eaa5b86f00cea>) nil nil nil xref--read-identifier-history nil)
  xref--read-identifier("Find definitions of: ")
  byte-code("\300\301!C\207" [xref--read-identifier "Find definitions of: "] 2)
  call-interactively(xref-find-definitions nil nil)
  command-execute(xref-find-definitions)

[-- Attachment #3: etags --]
[-- Type: text/plain, Size: 10582 bytes --]

Debugger entered--entering a function:
* read-passwd("Passphrase for symmetric encryption for /home/peni..." nil)
  epa-passphrase-callback-function(#s(epg-context :protocol OpenPGP :program "/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil :passphrase-callback (epa-file-passphrase-callback-function . "/home/peniblec/.authinfo.gpg") :progress-callback (epa-progress-callback-function . "Decrypting /home/peniblec/.authinfo.gpg") :edit-callback nil :signers nil :sender nil :sig-notations nil :process #<process epg> :output-file "/tmp/epg-outputxgqCot" :result nil :operation decrypt :pinentry-mode loopback :error-output "" :error-buffer #<buffer  *epg-error*>) SYM "/home/peniblec/.authinfo.gpg")
  epa-file-passphrase-callback-function(#s(epg-context :protocol OpenPGP :program "/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil :passphrase-callback (epa-file-passphrase-callback-function . "/home/peniblec/.authinfo.gpg") :progress-callback (epa-progress-callback-function . "Decrypting /home/peniblec/.authinfo.gpg") :edit-callback nil :signers nil :sender nil :sig-notations nil :process #<process epg> :output-file "/tmp/epg-outputxgqCot" :result nil :operation decrypt :pinentry-mode loopback :error-output "" :error-buffer #<buffer  *epg-error*>) SYM "/home/peniblec/.authinfo.gpg")
  epg--status-GET_HIDDEN(#s(epg-context :protocol OpenPGP :program "/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil :passphrase-callback (epa-file-passphrase-callback-function . "/home/peniblec/.authinfo.gpg") :progress-callback (epa-progress-callback-function . "Decrypting /home/peniblec/.authinfo.gpg") :edit-callback nil :signers nil :sender nil :sig-notations nil :process #<process epg> :output-file "/tmp/epg-outputxgqCot" :result nil :operation decrypt :pinentry-mode loopback :error-output "" :error-buffer #<buffer  *epg-error*>) "passphrase.enter")
  epg--process-filter(#<process epg> "[GNUPG:] INQUIRE_MAXLEN 100\n[GNUPG:] GET_HIDDEN pa...")
  accept-process-output(#<process epg> 1)
  epg-wait-for-status(#s(epg-context :protocol OpenPGP :program "/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil :passphrase-callback (epa-file-passphrase-callback-function . "/home/peniblec/.authinfo.gpg") :progress-callback (epa-progress-callback-function . "Decrypting /home/peniblec/.authinfo.gpg") :edit-callback nil :signers nil :sender nil :sig-notations nil :process #<process epg> :output-file "/tmp/epg-outputxgqCot" :result nil :operation decrypt :pinentry-mode loopback :error-output "" :error-buffer #<buffer  *epg-error*>) ("BEGIN_DECRYPTION"))
  epg-start-decrypt(#s(epg-context :protocol OpenPGP :program "/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil :passphrase-callback (epa-file-passphrase-callback-function . "/home/peniblec/.authinfo.gpg") :progress-callback (epa-progress-callback-function . "Decrypting /home/peniblec/.authinfo.gpg") :edit-callback nil :signers nil :sender nil :sig-notations nil :process #<process epg> :output-file "/tmp/epg-outputxgqCot" :result nil :operation decrypt :pinentry-mode loopback :error-output "" :error-buffer #<buffer  *epg-error*>) #s(epg-data :file "/home/peniblec/.authinfo.gpg" :string nil))
  epg-decrypt-file(#s(epg-context :protocol OpenPGP :program "/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil :passphrase-callback (epa-file-passphrase-callback-function . "/home/peniblec/.authinfo.gpg") :progress-callback (epa-progress-callback-function . "Decrypting /home/peniblec/.authinfo.gpg") :edit-callback nil :signers nil :sender nil :sig-notations nil :process #<process epg> :output-file "/tmp/epg-outputxgqCot" :result nil :operation decrypt :pinentry-mode loopback :error-output "" :error-buffer #<buffer  *epg-error*>) "/home/peniblec/.authinfo.gpg" nil)
  epa-file-insert-file-contents("/home/peniblec/.authinfo.gpg" nil nil nil nil)
  apply(epa-file-insert-file-contents ("/home/peniblec/.authinfo.gpg" nil nil nil nil))
  epa-file-handler(insert-file-contents "/home/peniblec/.authinfo.gpg" nil nil nil nil)
  insert-file-contents("~/.authinfo.gpg")
  auth-source-netrc-parse(:max 2305843009213693951 :require (:port) :file "~/.authinfo.gpg" :host t :user t :port "ssh")
  auth-source-netrc-search(:backend #<auth-source-backend auth-source-backend-12932da> :type netrc :max 2305843009213693951 :require (:port) :create nil :delete nil :port "ssh" :require (:port) :max 2305843009213693951)
  apply(auth-source-netrc-search :backend #<auth-source-backend auth-source-backend-12932da> :type netrc :max 2305843009213693951 :require (:port) :create nil :delete nil (:port "ssh" :require (:port) :max 2305843009213693951))
  auth-source-search-backends((#<auth-source-backend auth-source-backend-128eb04> #<auth-source-backend auth-source-backend-12932da> #<auth-source-backend auth-source-backend-1293302>) (:port "ssh" :require (:port) :max 2305843009213693951) 2305843009213693951 nil nil (:port))
  auth-source-search(:port "ssh" :require (:port) :max 2305843009213693951)
  tramp-parse-auth-sources("ssh")
  #f(compiled-function (x) #<bytecode -0x91f43f15f3a70d7>)((tramp-parse-auth-sources "ssh"))
  mapc(#f(compiled-function (x) #<bytecode -0x91f43f15f3a70d7>) ((tramp-parse-default-user-host "ssh") (tramp-parse-auth-sources "ssh") (tramp-parse-connection-properties "ssh") (tramp-parse-rhosts "/etc/hosts.equiv") (tramp-parse-shosts "~/.ssh/known_hosts") (tramp-parse-sconfig "~/.ssh/config")))
  tramp-completion-handle-file-name-all-completions("ssh:" "/")
  apply(tramp-completion-handle-file-name-all-completions ("ssh:" "/"))
  tramp-completion-file-name-handler(file-name-all-completions "ssh:" "/")
  file-name-all-completions("ssh:" "/")
  completion-file-name-table("/ssh:" #f(compiled-function (cand) #<bytecode -0x10bca56c8ccfa7>) t)
  all-completions("/ssh:" completion-file-name-table #f(compiled-function (cand) #<bytecode -0x10bca56c8ccfa7>))
  completion-pcm--all-completions("/" ("ssh:" point) completion-file-name-table #f(compiled-function (cand) #<bytecode -0x10bca56c8ccfa7>))
  completion-basic-all-completions("/ssh:" completion-file-name-table #f(compiled-function (cand) #<bytecode -0x10bca56c8ccfa7>) 5)
  #f(compiled-function (style) #<bytecode 0x1d925b84ec00208f>)(basic)
  completion--some(#f(compiled-function (style) #<bytecode 0x1d925b84ec00208f>) (basic partial-completion emacs22))
  completion--nth-completion(2 "/usr/local/share/emacs/28.0.50/lisp//ssh:" read-file-name-internal #f(compiled-function (cand) #<bytecode -0x10bca56c8ccfa7>) 41 (metadata (category . file) (completion--unquote-requote . t)))
  completion-all-completions("/usr/local/share/emacs/28.0.50/lisp//ssh:" read-file-name-internal #f(compiled-function (cand) #<bytecode -0x10bca56c8ccfa7>) 41 (metadata (category . file) (completion--unquote-requote . t)))
  completion-all-sorted-completions(12 53)
  icomplete--sorted-completions()
  icomplete-completions("/usr/local/share/emacs/28.0.50/lisp//ssh:" read-file-name-internal file-exists-p nil)
  icomplete-exhibit()
  (let ((non-essential t)) (icomplete-exhibit))
  icomplete-post-command-hook()
  read-from-minibuffer("Find file: " "/usr/local/share/emacs/28.0.50/lisp/" (keymap (keymap (32)) keymap (10 . minibuffer-complete-and-exit) (13 . minibuffer-complete-and-exit) keymap (menu-bar keymap (minibuf "Minibuf" keymap (tab menu-item "Complete" minibuffer-complete :help "Complete as far as possible") (space menu-item "Complete Word" minibuffer-complete-word :help "Complete at most one word") (63 menu-item "List Completions" minibuffer-completion-help :help "Display all possible completions") "Minibuf")) (27 keymap (118 . switch-to-completions)) (prior . switch-to-completions) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . minibuffer-complete) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil file-name-history "/usr/local/share/emacs/28.0.50/lisp/" nil)
  completing-read-default("Find file: " read-file-name-internal file-exists-p confirm-after-completion "/usr/local/share/emacs/28.0.50/lisp/" file-name-history "/usr/local/share/emacs/28.0.50/lisp/" nil)
  completing-read("Find file: " read-file-name-internal file-exists-p confirm-after-completion "/usr/local/share/emacs/28.0.50/lisp/" file-name-history "/usr/local/share/emacs/28.0.50/lisp/")
  read-file-name-default("Find file: " nil "/usr/local/share/emacs/28.0.50/lisp/" confirm-after-completion nil nil)
  read-file-name("Find file: " nil "/usr/local/share/emacs/28.0.50/lisp/" confirm-after-completion)
  find-file-read-args("Find file: " confirm-after-completion)
  byte-code("\300\301\302 \"\207" [find-file-read-args "Find file: " confirm-nonexistent-file-or-buffer] 3)
  call-interactively(find-file nil nil)
  command-execute(find-file)

[-- Attachment #4: Type: text/plain, Size: 661 bytes --]


I am mildly intrigued by this comment in icomplete-post-command-hook:

  (defun icomplete-post-command-hook ()
    (let ((non-essential t)) ;E.g. don't prompt for password!
      (icomplete-exhibit)))

As can be seen in the backtraces, prompts are definitely happening while
calling icomplete-exhibit; I have no idea whether this is suspicious, or
if that comment is a red herring…

My hunch is that icomplete sets up *something* that is not cleared and
keeps being triggered when the second prompt shows up; I haven't been
able to pinpoint what yet.

If any completion wizard out here has advice on how to debug this
further, I'm all ears!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#40152: 27.0.90; icomplete vs recursive prompts
  2021-01-24 15:06   ` Kévin Le Gouguec
@ 2021-02-04 18:39     ` Kévin Le Gouguec
  2021-08-19 22:05       ` João Távora
  0 siblings, 1 reply; 9+ messages in thread
From: Kévin Le Gouguec @ 2021-02-04 18:39 UTC (permalink / raw)
  To: 40152; +Cc: Stefan Monnier, João Távora

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#40152: 27.0.90; icomplete vs recursive prompts
  2021-02-04 18:39     ` Kévin Le Gouguec
@ 2021-08-19 22:05       ` João Távora
  0 siblings, 0 replies; 9+ messages in thread
From: João Távora @ 2021-08-19 22:05 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: 40152, Stefan Monnier

[-- Attachment #1: Type: text/plain, Size: 2280 bytes --]

Sorry Kévin, 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ão

On Thu, Feb 4, 2021, 19:20 Kévin Le Gouguec <kevin.legouguec@gmail.com>
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…
> 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.)
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2925 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-19 22:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-08-19 22:05       ` João Távora

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