zsh-workers
 help / color / mirror / code / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: zsh-workers@sunsite.dk
Subject: Re: Strange _values completion on accept-and-menu-complete and menu selection
Date: Sat, 25 Dec 2004 20:32:22 +0300	[thread overview]
Message-ID: <200412252032.23247.arvidjaar@mail.ru> (raw)
In-Reply-To: <Pine.LNX.4.61.0412121337040.16206@toltec.zanshin.com>

On Monday 13 December 2004 00:44, Bart Schaefer wrote:
> On Mon, 13 Dec 2004, Andrey Borzenkov wrote:
> > > Normally compstate[compound_word] would be unset, but "compvalues -i"
> > > would set it based on the parse.
> >
> > I still believe this is more general and should not be limited to _values
>
> Sure; compstate[compound_word] doesn't have to be read-only, any function
> that needs it could set it.  It just seems correct and convenient to have
> compvalues set it automatically.
>
> > Here is updated patch (which also fixes initialization problem).
>
> There's one line of shell code where you have compstate[compound] but want
> compstate[compound_word].  No need to repost, but fix before commit.
>

it is far from being suitable for commit (and I was off most of the time).

> > This still has problems in completing nested calls to _values (should it
> > work?)
>
> I don't have time to debug carefully just now, but I suspect without any
> real evidence that compstate[compound_word] is becoming unset on return
> from the nested call and therefore is wrong for the subsequent selections
> for the outer call.

it is more general problem. When match is inserted it has all parts - ignored 
prefix, prefix, etc insterted. In our case we actually have as iprefix 
everything up to separator - and get everything up to separator reinserted. 
It happens without any nested calls too:

{pts/0}% foo foo,TAB
{pts/0}% foo foo,bazzz,
Completing test values
barr   bazzz

and hitting a-a-m-c

{pts/0}% foo foo,bazzz,foo,barr

It is the same problem as completion in braces. Braces are treated as special 
case inside completion code unfortunately. Hopefully it is possile to 
generalize it.

-andrey


      parent reply	other threads:[~2004-12-25 17:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-11 10:11 Andrey Borzenkov
2004-12-11 21:05 ` Bart Schaefer
2004-12-12 16:15   ` Andrey Borzenkov
2004-12-12 17:51     ` Bart Schaefer
2004-12-12 21:06       ` Andrey Borzenkov
2004-12-12 21:44         ` Bart Schaefer
2004-12-13 10:43           ` Peter Stephenson
2004-12-25 17:32           ` Andrey Borzenkov [this message]

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=200412252032.23247.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --cc=zsh-workers@sunsite.dk \
    /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).