octave-maintainers
[Top][All Lists]
Advanced

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

Re: MSVC 2.9.13 and path completion with spaces


From: David Bateman
Subject: Re: MSVC 2.9.13 and path completion with spaces
Date: Fri, 05 Oct 2007 10:31:52 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

John W. Eaton wrote:
> On  4-Oct-2007, David Bateman wrote:
>
> | What I have at the moment that isn't far off is the attached... It adds
> | the missing leading quote and even completes into deep sub directories
> | (if they arg is quoted). However it doesn't add the trailing quote
> | character. I think this might be done with correct quoting and dequoting
> | functions. I use the default readline ones in this patch but have
> | written non working ones and the infrastructure to set them. However,
> | although the trailing quote is added with the attached it messes up with
> | things like
> | 
> | cd ("Di<TAB>
> | 
> | where "Dir One" is a directory. If I could just figure out how to add
> | the trailing quote character correctly this would be prefer.
>
> I tried the patch and the behavior I see for this is
>
>   cd ("Di<TAB>
>
> is converted to
>
>   cd ('Dir One/
>
> If there is a file in the directory, then another <TAB> results in
>
>   cd ('Dir One/two'"
>
> (assuming there is a single file named "two" in the "Dir One"
> directory).  If the file is missing, then yes, the completion stops at
> the / and does not append anything.
>   

The problem here is the readline filename_quoting function does this.. I
can replace this function and will in the final version and the " will
not be replaced with a '. I'll supply a new patch soon.


> Using 0 instead of '"' in the call to set_completion_append_character
>
>   if (list_index >= file_index)
>     command_editor::set_completion_append_character ('\0');
>
> seems to fix the problem with appending the double quote character.
> Does that change cause other problems?
>   
Probably not though I think I have a better solution to the overall problem.

> | If I replace pointed to by the third arg of  rl_quote_func_t with a "'" then
> | the attach seems to work correctly, except for things like
> | 
> | cd ("Dir\ O<TAB>
> | 
> | As it treats the \ as a character. This is fairly rare though. It
> | however looses the ability to do deep sub directory completion..
> | 
> | In any case with a little cleaning up this patch is already vastly
> | better than what is there already for path completion.. Any suggestions
> | how to add the trailing quote with this patch?
>
> It's hard to believe there is no way to do this, but I don't see it.
> Are there any readline experts we can ask for help?
>   
What I'm currently debugging adds a leading ' to pathname with
characters that need quoting and doesn't touch existing ' or "
characters. I've then bound a function to "accept-line" that checks for
whether a trailing quote needs to be added.. Its still buggy but I'll
send a version for comment soon.



> | If not what is the best
> | compromise? No trailing quote or no deep sub-directory completion?
>
> Fow now, I think I'd prefer to be able to complete subdirectories.
>   
This is what I'm aiming for.. The limitation will be that for
subdirectory completion the pathname must be quoted..

> Anyway, if you'd like, I think it is OK to check in the changes to the
> command_editor class and associated functions in the oct-rl-edit.{h,c}
> files but I'd prefer that you wait on the changes to input.cc.
>   
Wait till you see my new version :-)

D.





> Thanks,
>
> jwe
>
>   


-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

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