zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: setopt globcomplete and () broken
Date: Tue, 10 Mar 2009 18:18:18 +0000	[thread overview]
Message-ID: <200903101818.n2AIIIFk010993@news01.csr.com> (raw)
In-Reply-To: <237967ef0903101104y135e0ca6sdbd9fbe8272f2d99@mail.gmail.com>

Mikael Magnusson wrote:
> If I unsetopt globcomplete, I can ls *zshenv(D)<tab> with the
> paragraph deleted though, so it all seems a bit crazy to me.

Are you sure that's not going through _expand?  If I remove _expand from
the list of completers, I don't get completions for things like *zshe*(D)
unless glob_complete is set.

> 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?

They're not *necessarily* files, but they could be anything; and
if they are files, then globcomplete means exactly what it says,
complete based on full file glob expressions.

> And when completing actual files, why would globcomplete mean
> _path_files has to do extra work instead of just expanding the
> pattern?

The extra work in this particular case is merging together glob
qualifiers passed down (e.g. "-/" becoming "*(-/)") with any that are
there on the command line.  This is a rather specialised thing to do,
but you could e.g. complete "cd *(D)" and get files with dots.  (It only
applies with glob_complete because otherwise what's on the command line
is a plain string and you can just use "*(-/)" as the pattern.)
This does appear to work.  (In fact it appears to work even after the fix I
was going to propose for your original problem, which is encouraging.)

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


  reply	other threads:[~2009-03-10 18:20 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
2009-03-10 18:18       ` Peter Stephenson [this message]
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=200903101818.n2AIIIFk010993@news01.csr.com \
    --to=pws@csr.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).