This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: completion regression? [PATCH]
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 12 Oct 2006 12:56:31 +1300
- Subject: Re: completion regression? [PATCH]
- References: <17705.28835.758720.533078@kahikatea.snap.net.nz> <20061008220814.GA23132@nevyn.them.org> <17708.6256.497894.641872@kahikatea.snap.net.nz> <17708.52258.488888.118911@kahikatea.snap.net.nz> <20061011131755.GB24187@nevyn.them.org>
> Nope, sorry. With this patch applied:
>
> (gdb) file .<tab><tab>
> ..// .//
I see.
> Readline defines the interface for these functions, and that says we
> shouldn't include the slash. I think this happens in
> readline/complete.c:print_filename. Maybe there's somewhere else in
> GDB you can do this without breaking CLI tab completion?
Completion via the complete command doesn't use print_filename which is
presumably why there is no trailing slash in this case. I was just trying
to mimic it elsewhere.
I can get it to work by adding an argument to filename_completer:
filename_completer (char *text, char *word, int slash)
and complete_line and doing:
list = complete_line (text, line_buffer, point, 0);
from line_completion_function for completion through TAB
and:
completions = complete_line (point, arg, argpoint, 1);
from complete_command for Emacs.
It involves a lot of changes though because all the other completers need
an extra (unused) argument too.
Perhaps complete_command can be made to use print_filename.
--
Nick http://www.inet.net.nz/~nickrob