From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1054 invoked from network); 12 Oct 2008 22:48:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL autolearn=unavailable version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Oct 2008 22:48:30 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 5277 invoked from network); 12 Oct 2008 22:48:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Oct 2008 22:48:07 -0000 Received: (qmail 7423 invoked by alias); 12 Oct 2008 22:47:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25862 Received: (qmail 7402 invoked from network); 12 Oct 2008 22:47:53 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 12 Oct 2008 22:47:53 -0000 Received: from vms173003pub.verizon.net (vms173003pub.verizon.net [206.46.173.3]) by bifrost.dotsrc.org (Postfix) with ESMTP id 78D4780524C0 for ; Mon, 13 Oct 2008 00:47:48 +0200 (CEST) Received: from torch.brasslantern.com ([96.238.220.215]) by vms173003.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K8N00CCVDYZTSH1@vms173003.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 12 Oct 2008 17:47:24 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m9CMlMhU022724 for ; Sun, 12 Oct 2008 15:47:23 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m9CMlLK5022723 for zsh-workers@sunsite.dk; Sun, 12 Oct 2008 15:47:21 -0700 Date: Sun, 12 Oct 2008 15:47:19 -0700 From: Bart Schaefer Subject: Re: Regression in braces completion In-reply-to: <20081012204236.6669a668@pws-pc> To: "Zsh Hackers' List" Message-id: <081012154721.ZM22722@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20a807210810111932r1b32b746l3cca788a383e84ed@mail.gmail.com> <081011213249.ZM29979@torch.brasslantern.com> <081012001051.ZM30706@torch.brasslantern.com> <20081012204236.6669a668@pws-pc> Comments: In reply to Peter Stephenson "Re: Regression in braces completion" (Oct 12, 8:42pm) X-Virus-Scanned: ClamAV 0.92.1/8414/Sun Oct 12 05:30:50 2008 on bifrost X-Virus-Status: Clean On Oct 12, 8:42pm, Peter Stephenson wrote: } } There will be an underlying reason why this particular case inserts the } brace in the wrong place. It will take many hours of work to find out. It's not really "this particular case". The brace ends up in the wrong place in the following examples too: schaefer<508> ls abc{g,d schaefer<508> ls abcdef{g, schaefer<516> cd .. schaefer<517> ls dta/abc{d schaefer<517> ls dta/abcdef{ Seems to happen any time there's a longer unambiguous prefix possible. In order to find the possible completions of the rightmost expansion of the brace expression, the C code removes everything between the brace and the comma, inclusive, and then asks the completer (which happens to be _path_files) for the matches. It's not expecting the completer to modify the command line as a side-effect, but that's what happens when "compadd -U" is called. Is there a reason you think it's deeper than that? This one is interesting, though: schaefer<518> ls dat/abc{d schaefer<518> ls dta/abc{def/ Completing corrections abcdef/ abcdefg/ Completing original dat/abcd Note that it's wrong about what the "original" string is, and sort of wrong about what the corrections are, because really the correction is "dat" --> "dta" ... but in this case the brace is in the right place, and menu completion cycles through: schaefer<518> ls dta/abc{def/ schaefer<518> ls dta/abc{defg/ schaefer<518> ls dat/abc{d Looking at _complete_debug output, this seems in part to be because with the misspelt "dat" in front, "dta/abcghi" remains a candidate match until later in the process. It helps, when testing this stuff, to remove _expand and _oldlist from the completer style. --