[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MSVC 2.9.13 and path completion with spaces

From: John W. Eaton
Subject: Re: MSVC 2.9.13 and path completion with spaces
Date: Wed, 03 Oct 2007 11:55:16 -0400

On  3-Oct-2007, David Bateman wrote:

| Thinking more about this I see no logical way of getting this to work
| correctly with readline or rather with only the help of readline. How
| would readline know to append a quote to the end of the string? Does it
| do it for all filenames? What about if you want to go into a
| subdirectory that is 2 or more levels below the current level?
| I think a better solution might be to add a field
| symbol_record:TYPE:COMMAND_EXPECTS_ONE_ARG enum and set it for Fcd and
| Fls and perhaps others. Add the
| bool
| symbol_record::command_expects_one_arg ()
| {
|    return (symbol_type & symbol_record::COMMAND_EXPECTS_ONE_ARG);
| }
| method. Then in parse.y when constructing a word_list for a command
| check if the command expects a single argument, and if so don't split
| the elements of tree_argument_list which are of type octave_value_list
| into multiple octave_value but rather keep a single string respecting
| the white space...

I'd prefer to avoid doing that.  Instead, I think we need to make
quoting work with readline.  I haven't looked a the details, but bash
can complete filenames with spaces when they are quoted.  For example,
if there is a file called 'foo   bar', bash will complete it if it is

  ls 'foo<TAB>


  ls "foo<TAB>

and it will automatically insert the trailing quote.  You also have to
be careful with completion of filenames that include quote characters.
The bash code is in bashline.c in the bash sources.  We can't use
exactly what is used in bash because the languages are different (we
can't use \ for quoting spaces, for example) but I think it might be
helpful to look at the code there anyway.

Also, filename completion has been somewhat broken in Octave for a
long time (for example, try to complete a filename that includes a
directory separator character).  Maybe all of this could be fixed
after 3.0?  Or, if you see some simple fixes that would improve
things, we could do it now, but I'd rather not delay 3.0 for this
issue since it is not a new regression.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]