This is the mail archive of the gdb-patches@sources.redhat.com 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: complete command doesn't work for files...


Comments in code should not say why what is no longer in the code was incorrect... That is just confusing. So the text of the ChangeLog is not appropriate as a comment in the code.

But I have no problem adding a comment here. Something like:

if (c->completer == filename_completer)
{
/* See the commentary above about the specifics
of file-name completion. Here we start from the cursor
and work backwards to get the last filename in the current word. */
for (p = tmp_command + point - 1;
p > tmp_command
&& strchr (gdb_completer_file_name_break_characters, p[-1]) == NULL;
p--)
;



Jim



On Sep 24, 2003, at 4:30 PM, Andrew Cagney wrote:


Jim,
I don't have any authority on the patch itself, but I do think that
it would be really worth to directly insert inside the code the text
of your changelog entry. I find it easier to find the relevant
information when it's inside the code, as opposed to inside the
ChangeLog.

Joel, yes, that's correct pratice. ChangeLog contains what changed. The actual file should change why.


Andrew


* completer.c (complete_line): For filename completions, when you look for
the last word before the cursor, actually start from the cursor & work backwards,
rather than starting from the word you were handed. Starting from the
word doesn't work if the input contains more than one word - as it does
in the complete command.



--
Jim Ingham                                   jingham@apple.com
Developer Tools
Apple Computer


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