Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problem with fake-files style and cd
- X-seq: zsh-users 13859
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: Problem with fake-files style and cd
- Date: Sun, 15 Feb 2009 03:28:21 +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=jkJ4TRHAJjNfRoZXRPbK8xwtbfiEAYWxAeY2KQoQdGI=; b=Tg/vMDBWCTm46AxF2iDlX1sBuRrabT2BoE8bIWml+pOTXDciKUEXmzX5E7khldOvBQ +ukoPv1EYo/fuhmyMAQ0TiQdEOglbl69ef8nxkYpWQR9g55M2BZpCDmuNssjVTt5wv3X nh+f8TxjYG/Hgb6nDAybiiLs7b/I17bdPntoY=
- 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=Gbgx7+XNIleuHQcBG7gWdhGzTB1BSh8En9CVogt1yeGulJrXJPY5r7e6PM0VyUa6F3 Cf9k+Gm5KLt+PHliDSZ2R+2xZBtwNkB1371MKXC8Rq68HUVaa1JVA66pm+FDk7OZhW9j XWjkq66gJEpAJeHIKlhx+NfpGsMvIsXoVCYRc=
- In-reply-to: <237967ef0902141535j532bc256i5d0e08275fc9e164@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <mikachu@xxxxxxxxx> <237967ef0902140622s7389d2c8h5a0c786dcf207422@xxxxxxxxxxxxxx> <200902141801.n1EI1E2l003603@xxxxxxxxxxxxxxxxxxx> <237967ef0902141019t30118690m30116c9413015d96@xxxxxxxxxxxxxx> <090214111316.ZM15188@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0902141141y609b61d3i154546f6f6886c65@xxxxxxxxxxxxxx> <090214133904.ZM15383@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0902141409o3a0c30a1mfbae985453403342@xxxxxxxxxxxxxx> <090214152621.ZM15489@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0902141535j532bc256i5d0e08275fc9e164@xxxxxxxxxxxxxx>
2009/2/15 Mikael Magnusson <mikachu@xxxxxxxxx>:
> 2009/2/15 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>:
>> On Feb 14, 11:09pm, Mikael Magnusson wrote:
>> }
>> } > zstyle -e :completion::complete:cd::path-directories ignored-patterns \
>> } > 'reply=( *(/) )'
>> } >
>> } > This says that when completing in the cdpath, ignore any name that matches
>> } > the name of a directory in the current directory.
>> }
>> } while the above appears to work, it really doesn't:
>> } % mkdir path/code/foo
>> } % cd code/<tab>
>> } ---- local directory
>> } foo/
>> } ---- directory in cdpath
>> } bar/ foo/
>> }
>> } Presumably this is because *(/) (which I changed to *(-/) (not in the
>> } above testcase though)) only matches one segment and that *(/) is run
>> } in $PWD, not $PWD/$PREFIX?
>>
>> Yep, true. Try it this way:
>>
>> zstyle -e :completion::complete:cd::path-directories ignored-patterns \
>> 'reply=( ${PREFIX}*(-/) )'
>>
>> You might need to fool around with that a bit; for example, if you don't
>> use the _expand completer you may want ${~PREFIX}*(-/) instead. There
>> may also be tricky bits with IPREFIX, QIPREFIX, and special cases for
>> completing in the middle of a word instead of at the end.
>
> Aha, I didn't expect my wild guess to even have the correct variable
> name :). If it breaks though, the worst that could happen is that I
> get a duplicate entry in the listing though?
>
> Thanks! I'll try this for a while and see what happens.
Okay, it happened now,
% mkdir -p {local,path}/{'path with spaces',pathwithoutspaces}
% cd local
% cd path<tab>
---- local directory
pathwithoutspaces/ path\ with\ spaces/
---- directory in cdpath
path\ with\ spaces/
I tried putting some "" in various constellations in our zstyle to no
avail. Any ideas?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author