Zsh Mailing List Archive
Messages sorted by:
Re: [PATCH] Quote components before using it is pattern
- X-seq: zsh-workers 28183
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Quote components before using it is pattern
- Date: Sat, 21 Aug 2010 14:46:52 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+czUXYtbs0rpFQFQVrJSn9FZJld+wfUhoe+lPkbW2ak=; b=TIt0HO6lroQdLs2cUoY2VoZeRf1AkAr2lHf1R4Qt0Xmzk7yeM7RChP4ZoEsoFkljnk z9FJLYRG5FuUlUUr0tyxJjFwzA0zcoFQaJIkGvC3547I1YUrLEPzDTHWuYyf4Wo5QNWg 3W8qPSxYonU6tmBOH2GsVjsvgyuAt1MbbqL9o=
- 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=dlV/pDnK+EGp+ZSwMDnhjXutzoN5grpxatAdlku3FWgku0SLwAI6EWgvdolv3krdFP /RHhnrwS+8zG1xX4p+Az9zAtHOOXk2pdn7prCo3l42xiXUJjIC9VPFWsnHt+MmVwVZs5 nvz6LOlxsJ4KWq8+V4i5m3Zc2yHqnAiHhJRm4=
- In-reply-to: <20081014150144.GA3836@xxxxxxxxxxxx>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1223938893-2537-1-git-send-email-joerg@xxxxxxxxxxxx> <20081014150144.GA3836@xxxxxxxxxxxx>
On 14 October 2008 17:01, JÃrg Sommer <joerg@xxxxxxxxxxxx> wrote:
>> A component might contain a character active in patterns, like * or ().
>> Take for example the path /tmp/foobar). Passing this and /tmp/foo123 as a
>> completion to _multi_parts results in an error:
>> _multi_parts:147: bad pattern: (foo123|foobar))*
>> The characters in the temporary variable tmp1 must be quote, before the
>> pattern is build with them.
> Here is a simple test that shows the error in the old version:
> % compdef '_multi_parts -- / mpcompletions' mptest
> % mpcompletions=( a/foo\) a/f123 )
> % mptest a/<TAB>
> _multi_parts:147: bad pattern: (foo)|f123)*
This patch sort of breaks completing when the first segment has spaces
for me. They don't appear in the initial listing, but typing the first
char of their name sometimes completes them.
% compdef '_multi_parts -- / mpcompletions' mptest
% mpcompletions=3D( 'foo bar' 'foo baz' bar baz )
% mptest <TAB>ba<TAB>
In this particular test, the foo bar and foo baz don't seem to appear
at all in the list, but they _are_ accepted (ie a space is inserted)
when they are typed in full. Removing the added (q) fixes this but of
course breaks the original case again. I have no idea what the line
does or how it does it.
The realworld case is zip- and tar-files that contain files with spaces.
Messages sorted by: