This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: completion regression? [PATCH]


 > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]