On 9/4/11 9:51 PM, Clark J. Wang wrote: > Tested with 4.2.10. Overall it works fine for me. But it still has problem > for following scenario: > > $ complete -d -o bashdefault cd > $ cd $PWD<TAB> > # it expands to this: > $ cd \$PWD<SPACE> > > Bash 4.1 also behaves like that so I'm not sure if it's OK.
Out of scope. By default, readline always quotes matches as if they were filenames, and relies on the application to turn that off where appropriate. The -d option has the effect of telling readline to treat the matches as filenames, which causes them to be quoted. This points out a pair of opportunities, though: there is no option for a progcomp to tell readline to *not* quote the completions as if they were filenames, and it might be a good idea to save and restore the value of the `rl_filename_completion_desired' option when `complete -f' or `complete -d' returns no matches. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/