From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTP id D95CD385B835 for ; Thu, 9 Apr 2020 06:40:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D95CD385B835 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eliz@gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]:41856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jMQr5-0002eR-Cw; Thu, 09 Apr 2020 02:40:03 -0400 Received: from [176.228.60.248] (port=1751 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jMQr3-0002Z2-Ta; Thu, 09 Apr 2020 02:40:02 -0400 Date: Thu, 09 Apr 2020 09:39:41 +0300 Message-Id: <83369dp3gy.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey Cc: gdb-patches@sourceware.org In-Reply-To: <20200409024112.18065-1-tom@tromey.com> (message from Tom Tromey on Wed, 8 Apr 2020 20:41:12 -0600) Subject: Re: [PATCH] Add completion styling References: <20200409024112.18065-1-tom@tromey.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2020 06:40:05 -0000 > From: Tom Tromey > Date: Wed, 8 Apr 2020 20:41:12 -0600 > Cc: Tom Tromey > > 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 > > * 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 > > * 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.