zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Bug: Completion of the 'zsh' command.
Date: Thu, 10 Oct 2013 12:41:13 -0700	[thread overview]
Message-ID: <131010124113.ZM4512@torch.brasslantern.com> (raw)
In-Reply-To: <131009200134.ZM3418@torch.brasslantern.com>

On Oct 9,  8:01pm, Bart Schaefer wrote:
}
} Furthermore, I don't remember what '*:' does for _arguments

Figured out that it's shorthand for '*:::' which causes _arguments to
go though this branch (some whitespace removed for compactness):

    if [[ "$action" = \ # ]]; then
      # An empty action means that we should just display a message.
      _message -e "$subc" "$descr"

} there is first a call to _arguments which has the unintended (?) side-
} effect of erasing compstate[insert].

That's coming from "_message -e ..." which has:

  (( $compstate[nmatches] )) || compstate[insert]=

The problem of course is that we haven't finished generating all the
matches yet, so it's premature to test (( $compstate[nmatches] )).

Several possible approaches come to mind:

(1) The patch I already sent, which assures that this call to _message
happens late enough for $compstate[nmatches] to be valid.

(2) Instead of '*:' aka '*:::' as the last argument of _arguments in _sh,
actually give it an action, '*:::_default' (or something more clever).
This bypasses the call to _message -e, but makes it appear that every
zsh option (except -c) takes an argument, which (I think) changes the
zstyle context ... which probably hardly ever matters, but ...

(3) Fiddle with _message somehow, for example, shove the assignment to
compstate[insert] into a comppostfuncs callback -- except then I'm not
sure it happens soon enough, so we've exchanged one problem for another.

Anybody have an opinion?


  reply	other threads:[~2013-10-10 19:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 14:15 Kunshan Wang
2013-10-10  3:01 ` Bart Schaefer
2013-10-10 19:41   ` Bart Schaefer [this message]
2013-10-11  8:56     ` Peter Stephenson
2013-10-12  6:18       ` Bart Schaefer
2013-10-13 18:06         ` Peter Stephenson
2013-10-13 19:09           ` 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=131010124113.ZM4512@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).