From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22432 invoked by alias); 20 Oct 2011 21:45:40 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29836 Received: (qmail 5998 invoked from network); 20 Oct 2011 21:45:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at benizi.com does not designate permitted sender hosts) Date: Thu, 20 Oct 2011 17:44:56 -0400 (EDT) From: "Benjamin R. Haskell" To: Danek Duvall , zsh-workers@zsh.org Subject: Re: odd completion misbehavior? In-Reply-To: <20111020204800.GA28174@lorien.comfychair.org> Message-ID: References: <20111020204800.GA28174@lorien.comfychair.org> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Thu, 20 Oct 2011, Danek Duvall wrote: > With the following completion function: > > _danek() { > _arguments \ > "--zoo-name" \ > "--zipple-zoo-name" > } > > and running under zsh -f with only > > autoload -Uz compinit > compinit -i > compdef _danek danek > > if I type "danek --z", I end up with "danek --z-name", with the > cursor on the dash between "z" and "name". If I hit tab again, I end > up with "danek --zoo-name ", with the cursor after the final space. > If I setopt menucomplete, I get reasonable behavior. > > What have I done wrong with the completion function? (Everywhere below, I'm marking the cursor position with '|') Nothing. Zsh is completing the entirety of the unambiguous portions. All of the possible completions in that context: '--zoo-name' and '--zipple-zoo-name' begin with: '--z' and end with: '-name' So, zsh completes as much as possible. I'm also interested in a way to disable this behavior, but looking at all of the instances of 'suffix' and 'ambiguous' in anything remotely completion-related in zshall didn't turn up what style to set/unset (if such a style exists). In my case, the place this bothers me is with _mysql and the --default-character-set, --defaults-file, and --defaults-extra-file settings: mysql --def| mysql --default|- # makes sense mysql --defaults|- # add the 's' mysql --defaults|-file # okay, now everything starts w/ '--defaults' and ends w/ '-file' mysql --defaults-file=| # but, tab again gets me --defaults-file, even though it was still ambiguous with --defaults-extra-file Might be some way in which my styles are set up (accept-exact somewhere?). But, I'm still getting my feet wet with zstyle. -- Best, Ben