zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: completion oddity
Date: Tue, 22 May 2012 23:08:19 -0700	[thread overview]
Message-ID: <120522230819.ZM2600@torch.brasslantern.com> (raw)
In-Reply-To: <m3obpf966e.fsf@klanderman.net>
In-Reply-To: <m3ipfn95j4.fsf@klanderman.net>

On May 22,  6:55pm, Greg Klanderman wrote:
}
} OK, thanks for looking into this Bart.  So _main_complete is still
} looping over zstyle matcher-list values in completing parameters but
} it's not used?  I do see that _arguments uses _description which uses
} _matcher if non-empty (as you noted earlier).

Hmm, hadn't thought about that ... _parameters calls _wanted so it does
go through _description, which means the matcher-list is also applied
to parameter names.  At this point I have no idea whether that is
intentional.

} I have to confess I cannot follow all this completion code though.

I'm not sure anyone can.
 
On May 22,  7:09pm, Greg Klanderman wrote:
}
} > You're right; in the first case the completion system has recorded a
} > list of "ambiguous positions" that distinguish what it filled

Sorry, thinko there -- it actually records UNambiguous positions, and
insert_positions which are the places that something needs to be added
or changed in order that the word on the line match one of the possible
completions.

} Oh the horrors never end.. could you be so kind as to point me to some
} of the relevant bits of code that are doing this logic and how that
} state is stored?  Please tell me it's not in the even more
} impenetrable C code..

The state is available in the compstate hash, which is actually pretty
thoroughly documented (though exactly what the internals do with the
values isn't, so much).  However, yes, the logic that figures out what
are insert_positions and what are unambiguous_positions is all deep
in the C code.  There is exactly one example of shell code making use
of one of those values:  Functions/Zle/cycle-completion-positions --
but it's not very helpful.


  reply	other threads:[~2012-05-23  6:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21 21:40 Danek Duvall
2012-05-22  2:42 ` Bart Schaefer
2012-05-22  5:01   ` Danek Duvall
2012-05-22  5:16     ` Danek Duvall
2012-05-22  6:35       ` Bart Schaefer
2012-05-22 16:35         ` Greg Klanderman
2012-05-22 22:30           ` Bart Schaefer
2012-05-22 22:55             ` Greg Klanderman
2012-05-22 23:06         ` Danek Duvall
2012-06-15 10:43       ` #conpdef and compadd Eric Smith
2012-06-15 11:06         ` Mikael Magnusson
2012-06-15 19:22           ` #conpdef and compadd -> command regex Eric Smith
2012-06-15 22:22             ` Mikael Magnusson
2012-05-22 16:18   ` completion oddity Greg Klanderman
2012-05-22 22:57     ` Bart Schaefer
2012-05-22 23:09       ` Greg Klanderman
2012-05-23  6:08         ` Bart Schaefer [this message]
2012-05-23  1:03       ` Danek Duvall
2012-05-23  6:31         ` Bart Schaefer
2012-05-26 21:19           ` Danek Duvall
2012-05-23  6:25     ` Bart Schaefer
2012-05-23 18:48       ` Greg Klanderman
2012-05-24  3:39         ` Bart Schaefer

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=120522230819.ZM2600@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).