From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10867 invoked by alias); 22 Sep 2011 18:10:39 -0000 Received: (qmail 10856 invoked by uid 22791); 22 Sep 2011 18:10:37 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Sep 2011 18:10:18 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LRX00I00RM2D500@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Thu, 22 Sep 2011 21:10:16 +0300 (IDT) Received: from HOME-C4E4A596F7 ([77.127.239.98]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LRX00CHRRT30NL0@a-mtaout23.012.net.il>; Thu, 22 Sep 2011 21:10:16 +0300 (IDT) Date: Thu, 22 Sep 2011 18:13:00 -0000 From: Eli Zaretskii Subject: Re: [RFA, doc RFA] Add gdb.add_command_alias In-reply-to: To: Doug Evans Cc: pedro@codesourcery.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83boucsb3n.fsf@gnu.org> References: <20110909183636.444932461B1@ruffy.mtv.corp.google.com> <201109131839.49816.pedro@codesourcery.com> <201109132015.04463.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2011-09/txt/msg00414.txt.bz2 > Date: Wed, 21 Sep 2011 14:12:11 -0700 > From: Doug Evans > > @item alias [-a] -f @var{from} -t @var{to} > > instead of what I've written: > > @item alias [-a] -f FROM -t TO > > But I don't know how to properly refer to -f from in subsequent text > except as @samp{-f FROM} which is why I wrote what I wrote. > Suggestions welcome. Sorry, I don't understand the problem. Or maybe I do, see below. > -* New commands "info macros", and "info definitions" have been added. > +* New commands "info macros", and "info definitions", > + and "alias" have been added.^^^ Redundant "and". > +Python scripting language, and the third is defining new aliases of > +existing commands. ^^ "for", I think. > +@node Aliases > +@section Creating new spellings of existing commands Please add here an index entry: @cindex aliases for commands > +Define a new alias with the @samp{alias} command. You can define a new alias with the @samp{alias} command. > +@item alias [-a] -f FROM -t TO > + > +@end table > + > +@samp{-f FROM} and @samp{-t TO} may be specified in either order. If by "refer" above you mean refer to "-f FROM" etc., then what's wrong with @samp{-f @var{from}} ? > +The @samp{-f FROM} option specifies the name of an existing command > +that is being aliased. > + > +The @samp{-t TO} option specifies the name of the new alias. Btw, I'm not sure FROM and TO are a good idea; it's not like you are copying something. How about COMMAND and ALIAS instead? > +The @samp{-a} option specifies that the new alias is an abbreviation > +of the @samp{FROM} command, and will not appear in help command lists. Suggest a rewording: The @samp{-a} option specifies that the new alias is an abbreviation of the @samp{FROM} command. Abbreviations are not shown in command lists displayed by the @samp{help} command. > +Note that aliases are different than user-defined commands. ^^^^ "from" > +Here is an example where we make @samp{elms} an abbreviation of > +@samp{elements} in the @samp{set print elements} command. > +This is to show that you can make an abbreviation of any part > +of a command. > + > +@smallexample > +(gdb) alias -f "set print elements" -t "set print elms" > +(gdb) alias -f "show print elements" -t "show print elms" For didactic purposes, shouldn't these examples use -a? > +Note that if you are defining an alias of a @samp{set} command, > +you also need to define the alias of the corresponding @samp{show} > +command, if desired. "Need" and "if desired" are in contradiction. Which is it? Thanks.