public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: lsix@lancelotsix.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 4/6] gdb: add match formatter mechanism for 'complete' command output
Date: Fri, 12 Apr 2024 23:29:02 +0100	[thread overview]
Message-ID: <87il0m43m9.fsf@redhat.com> (raw)
In-Reply-To: <865xwms9ng.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andrew Burgess <aburgess@redhat.com>
>> Cc: gdb-patches@sourceware.org
>> Date: Fri, 12 Apr 2024 18:42:12 +0100
>> 
>> >   (gdb) file '/tmp/xx<TAB>
>> >    => (gdb) file '/tmp/xx/'
>> >   (gdb) file '/tmp/xx/'a<TAB>
>> >    => (gdb) file '/tmp/xx/abcd'
>> >
>> > That is, allow to type after the closing quote, and remove the closing
>> > quote before trying to complete.  This way, the user can use
>> > '/tmp/xx/' if that is what she needs, or continue typing and
>> > completing if not.
>> 
>> That does sound better.  I think there are still things that would need
>> figuring out.  For example, what if the user didn't do the second tab
>> completion, but just kept typing.
>> 
>>   (gdb) file '/tmp/xx<TAB>
>> 	=> (gdb) file '/tmp/xx/'
>>   (gdb) file '/tmp/xx/'abcd<ENTER>
>> 	=> ?? What would this do?
>> 
>> What if there really was a file /tmp/xx/'abcd ? What happens then?
>
> ENTER does the same as TAB, and then submits the result.  So GDB will
> see '/tmp/xx/abcd' in that case.

This all sounds great.  Do you know of any other readline based projects
that do completion like this?

My concern here is that, as I understand readline, this isn't going to
be easy to implement.  And even if we could (somehow) convince readline
to do this, it's going to result in a bunch of extra complexity compared
to just having readline do things the way it wants to.

And no, GDB doesn't have to use readline, but I'd rather not have to
throw out readline just so we can have working filename completion.

I'm not trying to be dismissive here.  This started as "Andrew's come up
with a design, he should have discussed it first."  And I'm trying to
work out if this is a serious, we should do it this other way.  Or if
this is just "See, there are other ways it could be done, you should
have discussed it first"?

To both of these my answer would be, I've not really invented anything
here, I've just connected up GDB with readline, and what we get is the
readline way of doing things.

Maybe then you know that readline can be made to do things differently
(hence me asking for examples).  Or maybe you're suggesting we should
forget readline and do things as you suggest ... I'm just trying to
figure out what you ideal end result is here.

Thanks,
Andrew


  reply	other threads:[~2024-04-12 22:29 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29 11:42 [PATCH 0/6] Further filename completion improvements Andrew Burgess
2024-03-29 11:42 ` [PATCH 1/6] gdb: improve escaping when completing filenames Andrew Burgess
2024-03-30 23:48   ` Lancelot SIX
2024-03-29 11:42 ` [PATCH 2/6] gdb: move display of completion results into completion_result class Andrew Burgess
2024-03-29 12:14   ` Eli Zaretskii
2024-03-30 23:30     ` Lancelot SIX
2024-03-31  5:49       ` Eli Zaretskii
2024-04-12 17:24         ` Andrew Burgess
2024-04-12 18:42           ` Eli Zaretskii
2024-04-12 22:20             ` Andrew Burgess
2024-04-13  6:36               ` Eli Zaretskii
2024-04-13  9:09                 ` Andrew Burgess
2024-04-13  9:46                   ` Eli Zaretskii
2024-04-12 17:31       ` Andrew Burgess
2024-03-29 11:42 ` [PATCH 3/6] gdb: simplify completion_result::print_matches Andrew Burgess
2024-03-30 23:48   ` Lancelot SIX
2024-03-29 11:42 ` [PATCH 4/6] gdb: add match formatter mechanism for 'complete' command output Andrew Burgess
2024-03-30 23:49   ` Lancelot SIX
2024-03-31  5:55     ` Eli Zaretskii
2024-04-12 17:42       ` Andrew Burgess
2024-04-12 18:44         ` Eli Zaretskii
2024-04-12 22:29           ` Andrew Burgess [this message]
2024-04-13  6:39             ` Eli Zaretskii
2024-03-29 11:42 ` [PATCH 5/6] gdb: apply escaping to filenames in 'complete' results Andrew Burgess
2024-03-29 11:42 ` [PATCH 6/6] gdb: improve gdb_rl_find_completion_word for quoted words Andrew Burgess
2024-04-20  9:10 ` [PATCHv2 0/8] Further filename completion improvements Andrew Burgess
2024-04-20  9:10   ` [PATCHv2 1/8] gdb/doc: document how filename arguments are formatted Andrew Burgess
2024-04-20  9:44     ` Eli Zaretskii
2024-04-27 10:01       ` Andrew Burgess
2024-04-27 10:06         ` Eli Zaretskii
2024-04-29  9:10           ` Andrew Burgess
2024-04-20  9:10   ` [PATCHv2 2/8] gdb: split apart two different types of filename completion Andrew Burgess
2024-04-20  9:10   ` [PATCHv2 3/8] gdb: improve escaping when completing filenames Andrew Burgess
2024-04-20  9:10   ` [PATCHv2 4/8] gdb: move display of completion results into completion_result class Andrew Burgess
2024-04-20  9:10   ` [PATCHv2 5/8] gdb: simplify completion_result::print_matches Andrew Burgess
2024-04-20  9:10   ` [PATCHv2 6/8] gdb: add match formatter mechanism for 'complete' command output Andrew Burgess
2024-04-20  9:10   ` [PATCHv2 7/8] gdb: apply escaping to filenames in 'complete' results Andrew Burgess
2024-04-20  9:10   ` [PATCHv2 8/8] gdb: improve gdb_rl_find_completion_word for quoted words Andrew Burgess
2024-06-05 13:36   ` [PATCHv3 0/7] Further filename completion improvements Andrew Burgess
2024-06-05 13:36     ` [PATCHv3 1/7] gdb: split apart two different types of filename completion Andrew Burgess
2024-06-06 16:18       ` Tom Tromey
2024-06-05 13:36     ` [PATCHv3 2/7] gdb: improve escaping when completing filenames Andrew Burgess
2024-06-05 13:36     ` [PATCHv3 3/7] gdb: move display of completion results into completion_result class Andrew Burgess
2024-06-06 16:19       ` Tom Tromey
2024-06-05 13:36     ` [PATCHv3 4/7] gdb: simplify completion_result::print_matches Andrew Burgess
2024-06-05 13:36     ` [PATCHv3 5/7] gdb: add match formatter mechanism for 'complete' command output Andrew Burgess
2024-06-06 16:14       ` Tom Tromey
2024-06-05 13:36     ` [PATCHv3 6/7] gdb: apply escaping to filenames in 'complete' results Andrew Burgess
2024-06-05 13:36     ` [PATCHv3 7/7] gdb: improve gdb_rl_find_completion_word for quoted words Andrew Burgess
2024-06-06 16:24     ` [PATCHv3 0/7] Further filename completion improvements Tom Tromey

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

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

  git send-email \
    --in-reply-to=87il0m43m9.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.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.
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).