zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: setopt globcomplete and () broken
Date: Tue, 10 Mar 2009 19:04:54 +0100	[thread overview]
Message-ID: <237967ef0903101104y135e0ca6sdbd9fbe8272f2d99@mail.gmail.com> (raw)
In-Reply-To: <20090310173424.1af302c5@news01>

2009/3/10 Peter Stephenson <pws@csr.com>:
> On Tue, 10 Mar 2009 13:51:46 +0000
> Peter Stephenson <pws@csr.com> wrote:
>>     elif [[ "$tmp1" = (#b)(*[^\$])(\(\([^\|~]##\)\)) ]]; then
>>       tmp2=( "$tmp2[@]" "${match[1]}((${tmp3}${match[2][3,-1]}" )
>
> I thought I was on the way to understanding what was going on here, but
> this attempt to match some form of glob qualifiers has stumped me.  Why are
> we specially matching a pattern ending with glob qualifiers wrapped in
> double parentheses?  What we're matching against, $tmp1, comes from patterns
> supplied to _files or _path_files as an argument; I can't see any sign the
> double parentheses are used, and the expansion manual says
>
>  A glob subexpression that would normally be taken as glob qualifiers, for
>  example (^x), can be forced to be treated as part of the glob pattern by
>  doubling the parentheses, in this case producing ((^x)).
>
> Yet we are treating it as if it's a glob expression ($tmp3 is the
> new glob qualifier we are trying to insinuate into the list).
>
> Can I simply hold my breath until it goes away?

If I delete that whole paragraph of code, my completion works as I
want, but I break what it wanted to fix,
http://www.zsh.org/mla/workers/2000/msg02437.html
http://www.zsh.org/mla/workers/2000/msg02455.html
http://www.zsh.org/mla/workers/2000/msg02456.html
http://www.zsh.org/mla/workers/2000/msg02458.html

If I unsetopt globcomplete, I can ls *zshenv(D)<tab> with the
paragraph deleted though, so it all seems a bit crazy to me. I thought
globcomplete was about completing things with patterns that weren't
files in the first place, so why do glob qualifiers come into the
picture at all? ie what I want to do is *2png<tab> and find my ps2png
program, I don't see how (D) would ever fit in there. I guess some
crazy people might have binaries starting with a ., but apart from the
sorting flags, none of the other glob qualifiers make any sense here,
do they?

And when completing actual files, why would globcomplete mean
_path_files has to do extra work instead of just expanding the
pattern? Put differently, why does globcomplete affect _path_files at
all? Hm, if i touch cat cbt, then with globcomplete on, c*t<tab> lets
me cycle between them, while with it off, it just inserts both
matches. (this is with
zstyle ':completion:*' completer _oldlist _complete _correct
)

In summary, I guess I have no idea how any of this works :).

-- 
Mikael Magnusson


  reply	other threads:[~2009-03-10 18:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10 13:25 Mikael Magnusson
2009-03-10 13:51 ` Peter Stephenson
2009-03-10 17:34   ` Peter Stephenson
2009-03-10 18:04     ` Mikael Magnusson [this message]
2009-03-10 18:18       ` Peter Stephenson
2009-03-10 18:30         ` Mikael Magnusson
2009-03-11  4:22           ` Bart Schaefer
2009-03-13  9:56         ` Peter Stephenson
2009-03-13 15:08           ` Bart Schaefer

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=237967ef0903101104y135e0ca6sdbd9fbe8272f2d99@mail.gmail.com \
    --to=mikachu@gmail.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).