Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Quoting problems with _zip (unzip) completer
- X-seq: zsh-workers 27220
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: Quoting problems with _zip (unzip) completer
- Date: Mon, 17 Aug 2009 23:59:44 +0200
- Cc: zsh-workers <zsh-workers@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=05VxmCsPKvEkcf1cDyw1nzbUK7DPKIL8zKHD++hFLyU=; b=JANH4JvsdnXhqygNo3ZmUJilKVhdktbGuPEjGVy1UWlH04RcAT1G1vHYJWWrAkZRb6 kIWwKXPxYCmph4brR18WJrnjLDD+kiJ7ywl9TdiuP1WxLXNfEarnmitsQo0bZUULXRE0 I080CxuIp1/7fgfSh9nzsxjBb+kwxIzXaDdpc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=w0XAlIJfyWNk2b1skYBXYC/KdqPyQ86LAt3zfsWh6h2mZzHLKC2fHshIJypnSNPGHN PzU4WAX3qpJJ1YjLhppMjYCNB+0+pcLScsXrkHpfJNwb8upW4TvfCmxDS7fx8IW/RGDF zQuyMY2dUT3N8aoG5kw3X6cw7LgfEzFJuhh7g=
- In-reply-to: <20090817224954.0b55b854@pws-pc>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0908031315u72fa3661i17ff7f0107b85b9c@xxxxxxxxxxxxxx> <200908040850.n748oxlc011862@xxxxxxxxxxxxxx> <20090817215819.796e9416@pws-pc> <20090817224954.0b55b854@pws-pc>
- Sender: nikolai.weibull@xxxxxxxxx
On Mon, Aug 17, 2009 at 23:49, Peter
Stephenson<p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Mon, 17 Aug 2009 21:58:19 +0100
> Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
>> So please watch out for any anomalous _arguments quoting behaviour.
>
> Found one in _rm... but it's not a knock-on effect of this patch, it's
> another thing that was already broken.
>
> Ârm stuff <TAB>
>
> is supposed to exclude "stuff" from being completed again by using the
> -F option to _files by together with the line from _arguments:
>
> Â Âignored=(${line//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
> Â Â_files -F ignored && ret=0
>
> However, the code for "_files -F <array>" was
> broken: Âinstead of appending the contents of <array> after the -F to
> the contents of the existing array, it appended the name <array>.
Great!
> (I'm not *quite* sure how this works, actually. ÂThe extra quoting shown
> in the code above protects pattern characters, since we're actually
> passing a pattern, not a file name, so 'foo\[bar' from line becomes
> 'foo\\\[bar'. ÂUnquoting the pattern characters gives 'foo\[bar' back as
> a literal match. ÂI don't understand why this matches the file... ÂI'm
> going to pretend I didn't notice.)
I don't want to sound pessimistic, but aren't we approaching a point
where the quoting and pattern matching code simply has to be
re(written|factored)? I'm not volunteering, but it seems that more or
less every bug fix goes something like "OK, I'm not sure what this
code is supposed to do, but it seems to work if we do X first". Who
wrote the quoting and pattern matching code? Was it Sven? Is he not
available to document this kind of stuff any longer?
I hope I don't sound critical of the development process. I have no
right to be. I just thought I'd mention my observation, seeing as I
failed to do so for the one below.
> I'm a bit surprised nobody noticed this wasn't working. ÂIf anyone finds
> this has a negative rather an a positive effect on ignoring files in
> "rm" completion, please try to reproduce it starting from "zsh -f".
I must confess that I had noticed it, but ignored it, figuring that my
code was broken and that it had been fixed in CVS. I should have
investigated this, and for not doing so I apologize.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author