From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2205 invoked by alias); 9 Sep 2010 16:35:43 -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: 28246 Received: (qmail 18852 invoked from network); 9 Sep 2010 16:35:37 -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,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100909093454.ZM16588@torch.brasslantern.com> Date: Thu, 09 Sep 2010 09:34:54 -0700 In-reply-to: <20100909145014.GL2506@plenz.com> Comments: In reply to Julius Plenz "Issue with insert-sections style" (Sep 9, 4:50pm) References: <20100909145014.GL2506@plenz.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Issue with insert-sections style MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 9, 4:50pm, Julius Plenz wrote: } } If you use the _oldlist completer together with the no_list_ambiguous } option the following bug occurs: When you have entered a man page name } with a prefix that can only be expanded to man pages from one section, } that section number gets inserted when drawing the listing, and then } *again* when the user enters menu completion. The trouble here is that the section number *and a trailing space* are passed to compadd as a prefix of the manual page name to be completed. On the subsequent TAB, that trailing space causes the section number on the line to be treated as a different word, and therefore it is not matched against the entries in the previously-generated completion list when it is re-used by _oldlist. This is a generic limitation of completion: it does not operates across $IFS-delimited boundaries, so any ambiguous match that includes an un- quoted $IFS character can produce confusion when completion is repeated on one of the substrings of the match. It might be possible to partly fix this in _oldlist by, e.g., testing for ${#${(z)_lastcomp[unambiguous]}} > 1 and discarding the old list in that case. (Can't use that test directly because if ${(z)...} yeilds only one word, ${#...} counts the number of characters, but you get the idea.)