zsh-workers
 help / color / mirror / code / Atom feed
From: Nikolai Weibull <now@bitwi.se>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: Quoting problems with _zip (unzip) completer
Date: Mon, 17 Aug 2009 23:59:44 +0200	[thread overview]
Message-ID: <dbfc82860908171459r2c986574o3f94159c1cfef246@mail.gmail.com> (raw)
In-Reply-To: <20090817224954.0b55b854@pws-pc>

On Mon, Aug 17, 2009 at 23:49, Peter
Stephenson<p.w.stephenson@ntlworld.com> wrote:
> On Mon, 17 Aug 2009 21:58:19 +0100
> Peter Stephenson <p.w.stephenson@ntlworld.com> 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.


  reply	other threads:[~2009-08-17 21:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03 20:15 Mikael Magnusson
2009-08-04  8:50 ` Peter Stephenson
2009-08-04 16:31   ` Mikael Magnusson
2009-08-17 20:58   ` Peter Stephenson
2009-08-17 21:49     ` Peter Stephenson
2009-08-17 21:59       ` Nikolai Weibull [this message]
2009-08-18  9:10         ` Peter Stephenson
2010-02-03  1:16     ` Mikael Magnusson
2010-02-03 22:09       ` Peter Stephenson
2010-02-03 22:43         ` Mikael Magnusson
2010-02-03 23:11           ` Benjamin R. Haskell
2010-02-03 23:21             ` Benjamin R. Haskell
2010-02-04 10:03           ` Peter Stephenson
2010-02-04 11:37         ` Peter Stephenson
2010-02-04 14:15           ` Benjamin R. Haskell
2010-02-04 14:22             ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dbfc82860908171459r2c986574o3f94159c1cfef246@mail.gmail.com \
    --to=now@bitwi.se \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).