unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 74944@debbugs.gnu.org
Cc: visuweshm@gmail.com
Subject: bug#74944: 31.0.50; Double TAB does not pop up *Completions* buffer when completing filename with dashes
Date: Sun, 22 Dec 2024 12:45:00 +0100	[thread overview]
Message-ID: <87pllk0wn7.fsf@ledu-giraud.fr> (raw)
In-Reply-To: <87cyhlusjb.fsf@ledu-giraud.fr> (Manuel Giraud via's message of "Sat, 21 Dec 2024 13:31:04 +0100")

Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Visuwesh <visuweshm@gmail.com> writes:
>
>> When completing filenames with dashes in them inside a shell-buffer,
>> double TAB does not pop open the *Completions* buffer because it
>> conflicts with argument completion.  To reproduce,
>>
>>     1. cd /tmp
>>     2. mkdir test; cd test
>>     3. touch blah_blah-pos-1.xyz; touch wowow-pos-1.xyz
>>     4. Go to this directory in a shell buffer
>>     5. Type rm pos.xyz TAB
>>     6. Observe how it completes to `rm -pos-1.xyz'
>>     7. Press TAB again and observe *Completions* buffer not popping up
>
> Hi Visuwesh,
>
> I can reproduce this.  FWIW, by instrumenting
> `shell-filename-completion' with edebug, I can see that there is a
> correct *Completions* buffer at some point but it "disappears" later.
> I'll try to investigate it further.

Hi,

I did some more tests but this issue is tricky for me and I'm not
familiar with the completion framework.  Anyway, here is what I did (and
think I understood):

        - First, I instrument `shell-filename-completion' with edebug
        
        - I enter "rm -pos-1.xyz" and hit Tab with the point is right
          after the 'z'

        - Edebug is trigerred and I can step through it hitting Space.

        - All seems fine, but at the end of this
          `shell-filename-completion' call (which returns something),
          Edebug is triggered again this time with the point placed just
          before the first '-'

I really don't understand why there is what seems to be a *second* call
to `shell-filename-completion' while the first one seems to have
succeeded.  The backtrace from the first call looks like this:

--8<---------------cut here---------------start------------->8---
  shell-command-completion()
  run-hook-with-args-until-success(shell-command-completion)
  comint-completion-at-point()
  completion--capf-wrapper(comint-completion-at-point all)
  run-hook-wrapped(completion--capf-wrapper comint-completion-at-point all)
  completion-at-point()
  funcall-interactively(completion-at-point)
  call-interactively(completion-at-point nil nil)
  command-execute(completion-at-point)
--8<---------------cut here---------------end--------------->8---

And here is the backtrace from this "second" call:
--8<---------------cut here---------------start------------->8---
  shell-command-completion()
  run-hook-with-args-until-success(shell-command-completion)
  comint-completion-at-point()
  #f(compiled-function () #<bytecode 0x347c002d48b3cbc>)()
  completion-in-region--postch()
--8<---------------cut here---------------end--------------->8---
-- 
Manuel Giraud





  reply	other threads:[~2024-12-22 11:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 12:50 bug#74944: 31.0.50; Double TAB does not pop up *Completions* buffer when completing filename with dashes Visuwesh
2024-12-21 12:31 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-22 11:45   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-12-26 13:11     ` Visuwesh

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=87pllk0wn7.fsf@ledu-giraud.fr \
    --to=bug-gnu-emacs@gnu.org \
    --cc=74944@debbugs.gnu.org \
    --cc=manuel@ledu-giraud.fr \
    --cc=visuweshm@gmail.com \
    /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).