Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: setopt globcomplete and () broken
- X-seq: zsh-workers 26712
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: setopt globcomplete and () broken
- Date: Tue, 10 Mar 2009 19:30:15 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=T8qBSQaBB1kVDD8jn0SkZIhRBuToRHrvAeys5+dGflk=; b=Edz2T9tu5ckiDbRjCsM/XUT3fgDj/gDaFWWWaAjQ1pyVV8/EwtyGECg4am0C66HJop mx/EQHp/YuAKVLrUaPZ3xEgtL57eBa22fRKU/AlIY2iekFdH8vHrDIJc9sMlk/BeiHnR EzgttKV5g04Rkm6gyAzOH1wj11DuO3wxHJVH4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=nerECdZlouACVLrNMS+VDOsmxws8ewBy5lSf+xGS5Uh4npdEFGT/d+500oIp9Z64Th TTciSRRsE5BGQPZJFpXUJiKDOob6mjPbmIUwgl2GZjXScBeRjbNf4floCHllzc2K8GRT 5zD4I8Br8zBkqAHOe9z8IN4nNRCrEo8QCNDdo=
- In-reply-to: <200903101818.n2AIIIFk010993@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0903100625s7e8e5908t7852ade0c1d6d8d3@xxxxxxxxxxxxxx> <20090310135146.30c0c794@news01> <20090310173424.1af302c5@news01> <237967ef0903101104y135e0ca6sdbd9fbe8272f2d99@xxxxxxxxxxxxxx> <200903101818.n2AIIIFk010993@xxxxxxxxxxxxxx>
2009/3/10 Peter Stephenson <pws@xxxxxxx>:
> 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.
Well, as i wrote further down my completer list is _oldlist _complete
_correct, i don't know if that is a yes or a no :).
>> 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.
Okay, so I was testing if ls --*e(#e)<tab> worked with globcomplete
on, which it does (ie it only lists options ending in 'e'). But since
I forgot which flag meant end of string, i pressed tab at the #, but
got
_path_files:25: command not found: _globflags
printed 5 or 6 times, if I run autoload _globflags it works. This
seems odd to me since _globquals seems to work without any special
treatment.
>> 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.)
Okay, there is probably a whole level of stuff going on here that I
wasn't even aware of.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author