zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: matcher-list doesn't work with some completers?
Date: Thu, 6 Jan 2011 19:42:51 +0100	[thread overview]
Message-ID: <AANLkTi=m-sFf6+uXYV7k17i4rW2r7c0LZB9G4WmL6EfC@mail.gmail.com> (raw)
In-Reply-To: <110106092447.ZM20931@torch.brasslantern.com>

On 6 January 2011 18:24, Bart Schaefer <schaefer@brasslantern.com> wrote:
> 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.

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...

-- 
Mikael Magnusson


  reply	other threads:[~2011-01-06 18:43 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
2011-01-06 18:42     ` Mikael Magnusson [this message]
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='AANLkTi=m-sFf6+uXYV7k17i4rW2r7c0LZB9G4WmL6EfC@mail.gmail.com' \
    --to=mikachu@gmail.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).