From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3948 invoked by alias); 7 Nov 2012 15:13:58 -0000 Received: (qmail 3937 invoked by uid 22791); 7 Nov 2012 15:13:57 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Nov 2012 15:13:50 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4BB4F2E08B; Wed, 7 Nov 2012 10:13:50 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id NxTdiYNAxORm; Wed, 7 Nov 2012 10:13:50 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 16DFF2E085; Wed, 7 Nov 2012 10:13:50 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id AE4DCC562D; Wed, 7 Nov 2012 07:13:42 -0800 (PST) Date: Wed, 07 Nov 2012 15:13:00 -0000 From: Joel Brobecker To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] partial fix PR 14777: Add abbrev cmd 'fo' for 'forward-search'. Message-ID: <20121107151342.GG5103@adacore.com> References: <1352293267-6640-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1352293267-6640-1-git-send-email-yao@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00145.txt.bz2 > We can fix this problem in two ways, either remove this line above > from the doc or define "fo" as the abbreviated command of > 'forward-search'. IMO, latter is better, so this is what this patch > does. I tend to agree. > gdb/doc: > 2012-11-07 Yao Qi > > * gdb.texinfo (Search): Add kindex for 'fo'. Needs approval from Eli. > gdb: > 2012-11-07 Yao Qi > > PR gdb/14777. > * source.c (_initialize_source): Call add_com_alias to abbreviate > 'forward-search' as 'fo'. OK. I should also add that we should make sure that we do not approve updates to the manual that document command abbreviations without specifically defining the abbreviation in our code. As demonstrated in this case, implicit abbreviations may become ambiguous over time. > --- > gdb/doc/gdb.texinfo | 1 + > gdb/source.c | 1 + > 2 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index c2c7745..c7777e6 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -6955,6 +6955,7 @@ regular expression. > @table @code > @kindex search > @kindex forward-search > +@kindex fo @r{(@code{forward-search})} > @item forward-search @var{regexp} > @itemx search @var{regexp} > The command @samp{forward-search @var{regexp}} checks each line, > diff --git a/gdb/source.c b/gdb/source.c > index bd11c63..307fecc 100644 > --- a/gdb/source.c > +++ b/gdb/source.c > @@ -1953,6 +1953,7 @@ The address is also stored as the value of \"$_\".")); > Search for regular expression (see regex(3)) from last line listed.\n\ > The matching line number is also stored as the value of \"$_\".")); > add_com_alias ("search", "forward-search", class_files, 0); > + add_com_alias ("fo", "forward-search", class_files, 1); > > add_com ("reverse-search", class_files, reverse_search_command, _("\ > Search backward for regular expression (see regex(3)) from last line listed.\n\ > -- > 1.7.7.6 -- Joel