Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] "Help" command and completion
Date: Wed, 09 Jan 2002 10:27:00 -0000	[thread overview]
Message-ID: <3C3C8A57.94E405F8@redhat.com> (raw)
In-Reply-To: <Pine.SUN.3.91.1020109095204.655D-100000@is>

Eli Zaretskii wrote:
> 
> On Tue, 8 Jan 2002, Michael Snyder wrote:
> 
> > Michael Snyder wrote:
> > >
> > > Eli Zaretskii wrote:
> > > >
> > > > How is no completion better than completion on symbols?
> > >
> > > Because the symbols in the program being debugged
> > > can't possibly have anything to do with gdb commands,
> > > and therefore can't possibly be valid arguments for "help".
> > > Not even if you're debugging gdb.
> >
> > OK to commit?
> 
> Personally, I'd rather have it complete on commands, like you said it
> should.  We already have the function to do that: complete_on_cmdlist,
> so it shouldn't be too hard to make that happen.

Excellent!  I was looking for that, but didn't find it.
My patch was meant to be an incremental improvement, 
yours is the proper way to do things.
 
> In fact, I just took a quick attempt on that; the patch is below.  It
> seems to work for me.  (The diffs are against stock GDB 5.1, since
> that's what I happen to have on the machine I have here.)
> 
> In any case, IIRC completion is Fernando's land, so I guess we need to
> wait for his word.
> 
> 2002-01-09  Eli Zaretskii  <eliz@is.elta.co.il>
> 
>         * completer.c (command_completer): New function.
> 
>         * completer.h <command_completer>: Add prototype.
> 
>         * cli/cli-cmds.c (init_cli_cmds): Make command_completer be the
>         completer for the "help" command.
> 
> --- gdb/completer.c~0   Sun Jul 15 21:17:46 2001
> +++ gdb/completer.c     Wed Jan  9 09:05:48 2002
> @@ -339,6 +339,14 @@ location_completer (char *text, char *wo
>    return list;
>  }
> 
> +/* Complete on command names.  Used by "help".  */
> +char **
> +command_completer (char *text, char *word)
> +{
> +  return complete_on_cmdlist (cmdlist, text, word);
> +}
> +
> +
>  /* Here are some useful test cases for completion.  FIXME: These should
>     be put in the test suite.  They should be tested with both M-? and TAB.
> 
> --- gdb/completer.h~0   Sun Jul 15 21:17:46 2001
> +++ gdb/completer.h     Wed Jan  9 08:52:50 2002
> @@ -29,6 +29,8 @@
> 
>  extern char **location_completer (char *, char *);
> 
> +extern char **command_completer (char *, char *);
> +
>  extern char *get_gdb_completer_word_break_characters (void);
> 
>  extern char *get_gdb_completer_quote_characters (void);
> --- gdb/cli/cli-cmds.c~0        Mon Jul 16 16:33:46 2001
> +++ gdb/cli/cli-cmds.c  Wed Jan  9 08:58:40 2002
> @@ -668,7 +668,8 @@ when gdb is started.", &cmdlist);
>    c->completer = filename_completer;
> 
>    add_com ("quit", class_support, quit_command, "Exit gdb.");
> -  add_com ("help", class_support, help_command, "Print list of commands.");
> +  c = add_com ("help", class_support, help_command, "Print list of commands.");
> +  c->completer = command_completer;
>    add_com_alias ("q", "quit", class_support, 1);
>    add_com_alias ("h", "help", class_support, 1);
>


      parent reply	other threads:[~2002-01-09 18:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-04 18:52 Michael Snyder
2002-01-05  0:53 ` Eli Zaretskii
2002-01-05 13:01   ` Michael Snyder
2002-01-08 15:15     ` Michael Snyder
2002-01-08 23:54       ` Eli Zaretskii
2002-01-09  7:19         ` Fernando Nasser
2002-01-09 10:28           ` Michael Snyder
2002-01-09 11:14             ` Eli Zaretskii
2002-01-09 11:22               ` Daniel Jacobowitz
2002-01-09 11:24                 ` Christopher Faylor
2002-01-10  0:41                   ` Eli Zaretskii
2002-01-10  7:28                     ` Andrew Cagney
2002-01-13 11:36                       ` Andrew Cagney
2002-01-10  0:19                 ` Eli Zaretskii
2002-01-10  0:18             ` Eli Zaretskii
2002-01-13 11:37               ` Andrew Cagney
2002-01-09 10:27         ` Michael Snyder [this message]

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=3C3C8A57.94E405F8@redhat.com \
    --to=msnyder@redhat.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.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