zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: matcher-list doesn't work with some completers?
Date: Thu, 06 Jan 2011 09:24:46 -0800	[thread overview]
Message-ID: <110106092447.ZM20931@torch.brasslantern.com> (raw)
In-Reply-To: <110106084111.ZM20766@torch.brasslantern.com>

On Jan 6,  8:41am, Bart Schaefer wrote:
>
> > ls dir<tab> #works
> > du dir<tab> #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.

-- 


  reply	other threads:[~2011-01-06 17:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06 10:14 Mikael Magnusson
2011-01-06 16:41 ` Bart Schaefer
2011-01-06 17:24   ` Bart Schaefer [this message]
2011-01-06 18:42     ` Mikael Magnusson
2011-01-06 19:00       ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=110106092447.ZM20931@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).