[RFA, doc RFA] Add gdb.add_command_alias
Doug Evans
dje@google.com
Thu Sep 22 21:48:00 GMT 2011
On Thu, Sep 22, 2011 at 11:09 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> -* New commands "info macros", and "info definitions" have been added.
>> +* New commands "info macros", and "info definitions",
>> + and "alias" have been added.^^^
>
> Redundant "and".
Blech, I thought I had removed that.
Will fix.
>> +Python scripting language, and the third is defining new aliases of
>> +existing commands. ^^
>
> "for", I think.
Ok.
>> +@node Aliases
>> +@section Creating new spellings of existing commands
>
> Please add here an index entry:
>
> @cindex aliases for commands
Ok.
>> +Define a new alias with the @samp{alias} command.
>
> You can define a new alias with the @samp{alias} command.
Ok.
>> +@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}}
That works.
>> +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?
Ok, but then I have to wonder about -f and -t.
-c and -a? [setting aside -a collides with the current -a for abbreviation]
But if you're happy with -f COMMAND -t ALIAS, great.
>> +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.
Ok.
>> +Note that aliases are different than user-defined commands.
> ^^^^
> "from"
Ok.
>> +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?
Ok.
>> +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?
How about if I reword it to:
Note that if you are defining an alias of a @samp{set} command,
and you want to have an alias for the corresponding @samp{show}
command, then you need to define the latter separately.
[i.e. it may be confusing, but it's not a contradiction]
More information about the Gdb-patches
mailing list