From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26091 invoked by alias); 21 Aug 2010 13:41:16 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28183 Received: (qmail 10479 invoked from network); 21 Aug 2010 13:41:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.171 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: <20081014150144.GA3836@alea.gnuu.de> References: <1223938893-2537-1-git-send-email-joerg@alea.gnuu.de> <20081014150144.GA3836@alea.gnuu.de> Date: Sat, 21 Aug 2010 14:46:52 +0200 Message-ID: Subject: Re: [PATCH] Quote components before using it is pattern From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 14 October 2008 17:01, J=C3=B6rg Sommer wrote: > Hi, > >> 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=3D( a/foo\) a/f123 ) > % mptest a/ > _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=3D3D( 'foo bar' 'foo baz' bar baz ) % mptest ba bar baz 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. --=20 Mikael Magnusson