Re: [PATCH 12/40] "complete" command and completion word break characters

Keith Seitz
2017-07-14T17:50:00Z

On 06/02/2017 05:22 AM, Pedro Alves wrote:
> First, the complete command has a too-simple approximation of what
> readline's TAB-completion code does to find the completion word point.
> Unfortunately, readline doesn't expose the functionality it uses
> internally, so to fix this this patch copies over the relevant code,
> and adjusts it a bit to better fit the use cases we need it for.
> (Specifically, our version avoids relying on the
> rl_word_break_characters, etc. globals, and instead takes those as
> arguments.)

re: "copies over the relevant code"
Is it possible to mention this in/around the copied code? That might make it easier to track differences in the future, e.g., if someone found a problem with the copied code, he could look upstream for a fix (or report a bug).

>
> diff --git a/gdb/completer.h b/gdb/completer.h
> index e554bff..207781d 100644
> --- a/gdb/completer.h
> +++ b/gdb/completer.h
> @@ -203,6 +203,10 @@ extern void complete_line (completion_tracker &tracker,
> const char *line_buffer,
> int point);
>
> +extern const char *completion_find_completion_word (completion_tracker &tracker,
> + const char *text,
> + int *quote_char);
> +

Missing comment?

Keith