Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Add completion styling
Date: Thu, 09 Apr 2020 09:39:41 +0300	[thread overview]
Message-ID: <83369dp3gy.fsf@gnu.org> (raw)
In-Reply-To: <20200409024112.18065-1-tom@tromey.com> (message from Tom Tromey on Wed, 8 Apr 2020 20:41:12 -0600)

> From: Tom Tromey <tom@tromey.com>
> Date: Wed,  8 Apr 2020 20:41:12 -0600
> Cc: Tom Tromey <tom@tromey.com>
> 
> Readline has a styling feature for completion -- if it is enabled, the
> common prefix of completions will be displayed in a different style.
> This doesn't work in gdb, because gdb implements its own completer.
> 
> This patch implements the feature.  However, it doesn't directly use
> the Readline feature, because gdb can do a bit better: it can let the
> user control the styling using the existing mechanisms.

Would it make sense to default to the style determined by the user's
colored-completion-prefix setting?

Also, do we want the default styling to be no-styling, or do we want
something else?

> gdb/ChangeLog
> 2020-04-08  Tom Tromey  <tom@tromey.com>
> 
> 	* NEWS: Add entry for completion styling.
> 	* completer.c (_rl_completion_prefix_display_length): Move
> 	declaration earlier.
> 	(gdb_fnprint): Use completion_style.
> 	(gdb_display_match_list_1): Likewise.
> 	* cli/cli-style.c (completion_style): New global.
> 	(_initialize_cli_style): Register new global.
> 	* cli/cli-style.h (completion_style): Declare.
> 
> gdb/doc/ChangeLog
> 2020-04-08  Tom Tromey  <tom@tromey.com>
> 
> 	* gdb.texinfo (Output Styling): Mention "completion" styling.
> 	(Editing): Mention readline completion styling.

The documentation parts are okay, but maybe we should say something
about the default styling of this, even if the default is no styling.

Btw, Emacs solves this problem differently: it uses a distinct styling
for the first character that distinguishes between completion
candidates.  I wonder if that idea is more useful for quickly
realizing what one needs to type next.  Or do we want to follow
Readline here for consistency reasons?

Thanks.


  reply	other threads:[~2020-04-09  6:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09  2:41 Tom Tromey
2020-04-09  6:39 ` Eli Zaretskii [this message]
2020-04-24 19:51   ` Tom Tromey
2020-04-24 20:00     ` Eli Zaretskii
2020-04-24 20:37       ` Tom Tromey
2020-05-16 19:18     ` Tom Tromey
2020-05-16 19:25       ` Eli Zaretskii
2020-05-23 20:52       ` Tom Tromey
2020-05-23 21:48         ` Philippe Waroquiers
2020-05-24  0:26         ` Hannes Domani
2020-05-24 10:16         ` Tom de Vries
2020-05-25  8:06           ` Tom de Vries
2020-05-24 14:54         ` Tom Tromey
2020-05-24 12:58     ` Pedro Alves
2020-05-24 14:42       ` Eli Zaretskii
2020-05-24 15:30         ` Pedro Alves
2020-05-24 16:29           ` Eli Zaretskii
2020-05-24 16:44             ` Pedro Alves

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=83369dp3gy.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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