Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Better completion in quotes



On May 27,  1:10pm, Sven Wischnowsky wrote:
} Subject: Re: Some possible bugs...
}
} > For example, when
} > the effective compctl says to complete file names, treat the entire
} > quoted string as one word and attempt to complete it as a file (this is
} > what bash appears to do); similary for command names or anything else
} > that normally results in a single shell "word"; otherwise, complete the
} > way it's presently done.
} 
} I think [splitting at spaces] wouldn't be enough. One example is the:
} 
}   % zsh -c "ls 'foo b<TAB>
} 
} I mentioned. This should complete to 'foo bar' if there is such a
} possible match.

Ideally, yes, but even knowing whether or not to split again at spaces,
and what context to complete in if not, is more than e.g. bash does.

The problem is that no context at all is causing zsh to make the wrong
assumption about how it should behave in a very common case.

} So we would need a way to `remove one level of
} quotes'. But the quotes may also contain things where we would need
} the whole lexing/parsing if we suddenly decide to work on the parts of 
} the quoted string.

True.  It'd have to re-parse the whole string after one level of quotes
was removed.  That may be overkill.

} > This so-called -1 option could apply to any other flag that followed it,
} 
} If we just let it work on all flags surrounding it, at least the
} parsing would be simple (of course).

That would be fine.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author