From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 882 invoked by alias); 6 Jan 2011 18:43:00 -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: 28583 Received: (qmail 20682 invoked from network); 6 Jan 2011 18:42:57 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.178 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=NZB06/XxjwCbrx4jNs1q9JBOrJsoAW/1U56coIngKGg=; b=dhkpFfkYSrCAgq0Ce0u8s00oR6xgunG3ZNL+lWa/Y83xe2sQMRhnKQZlVsA6amj4t4 h1jhN8xk/S7SNyebAdvqYjjhRlJHfk0h0YxSh3xRU9L4+AMI5CBmbwSVBYkWeBhRV9IK VsqOqLTDwoapS5ttjfiihxdpramDhhp2fV290= 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=H3w97r1ucOJ1Nq0RjCH3+1PXm5nstYfaiushk0bH1fOVHoq70diFBi9ep3EBqPXSGr AmoTJktPbmOZPnPT+oAbta5B1O9ugTa5cJzq/PlT59XkCrpOfO2ZLWEXRF5hj4mCGjrn ZoVxgeBWdv2yi/oCy55Sf371nwRw/8v8sFz5Y= MIME-Version: 1.0 In-Reply-To: <110106092447.ZM20931@torch.brasslantern.com> References: <110106084111.ZM20766@torch.brasslantern.com> <110106092447.ZM20931@torch.brasslantern.com> Date: Thu, 6 Jan 2011 19:42:51 +0100 Message-ID: Subject: Re: matcher-list doesn't work with some completers? From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 6 January 2011 18:24, Bart Schaefer wrote: > On Jan 6, =C2=A08:41am, Bart Schaefer wrote: >> >> > ls dir #works >> > du dir #nothing >> >> This is a bug in _du, it's returning a 0 status without ever adding any >> matches, which causes _dispatch in turn to report success to _complete >> which then skips running the matcher-list. >> >> This in turn is because _du checks for a state transition to handle the >> --time and --time-style options, and that case statement masks the >> return value from _arguments. > > Incidentally, the way I approach debugging this stuff (especially when > there's one working and one non-working example as above) is to use > the _complete-debug binding (^X?) to get a temp file xtrace dump of > each of the different cases, and then diff them to look for places > where the flow of control may be going awry. > > In the examples above, _complete went on to line 64 after _ls was > finished, but exited at line 63 for _du, which made it obvious that > _du was returning 0 even though it hadn't done anything. Thanks for the fix and the tip, I see also that I was probably the one to break _du since I added those options, but I had no idea the return value was even used by the completion system. I guess I'll have a go at fixing _mkdir then... --=20 Mikael Magnusson