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

Re: Better completion in quotes



Sven Wischnowsky wrote:
>    So, as a much simpler solution I suggest to make the completion
>    code turn strings with quotes into a generic quoted form, using
>    backslashes. But it is a bit ugly that
> 
>      % ls 'foo b<TAB>
> 
>    would be turned into foo\ bar. If this is unacceptable, we could
>    treat strings beginning with a quote as a special case and have the 
>    code re-insert the quote at the beginning and automatically insert
>    the closing quote, that wouldn't be too hard, but I'm not sure I
>    like this special casing. I could be convinced, though.

This seems to me the key issue in making it work the way people are
expecting, so I'm not too unhappy about the idea of this being a special
case.  It's preferable to the horror of handling quotes in the middle of
words properly, which I can easily believe is too much work.  But I think
it's also preferable to swapping the quotes for backslashes in this case:
it works neatly the way most users will try most of the time, and it offers
you some way of having your quotes left as they are; and bash has this
problem too, only worse as it just beeps if there's a quote in the middle
of the word.  So long as the documentation is explicit about "foo' b" and
"'foo b" completing differently, I would say let them have quotes.

(I would hazard a guess there are not a few users around who don't even
know you can stick quotes in the middle of words... it wasn't obvious to me
when I first came to UNIX some time ago.  People may even think changing
those is a feature.  "Urgh, someone's stuck some quotes in the middle of
the word.  It would look much better with backslashes...")

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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