From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2753 invoked by alias); 7 Sep 2016 06:30:26 -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: 39205 Received: (qmail 2785 invoked from network); 7 Sep 2016 06:30:25 -0000 X-Qmail-Scanner-Diagnostics: from mail-pa0-f50.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.50):SA:0(0.0/5.0):. Processed in 0.661717 secs); 07 Sep 2016 06:30:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=cYAv68bF58N7vLP0ZdjP+qqONM79qIm7bDiI4r/seBY=; b=fjNtfWPUNeWYSKNbXLVAYmeCx7IIUGufCnhMWJXvCrWiCuSbya854bU74Y1K4hIr+H AL9LjHYMlDPkPX6K3xD6CGfdX2YFxXzHmpL/4CKr6UM5sjm7xAI4jWiECJfkRHsnR6Z0 SSsE/WPhveiiN+pvI6E/srucSRfA2CCINAPSqLg/7G9wPgTKng8VzLTFSKK2xuR3sN6/ Vny6/uqEHDH1ItbGlntgrtldQrLZUsPlzY+5fpPGPtXlZKDKK4pMCz5b7qwuQ2/wo//U FrwrjojhFgsxQN17wQ2jMddwlJ8qsyxh2y22tR0oLke1j9T8tLmyGuIxE8TxOTiPl3oj 88Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=cYAv68bF58N7vLP0ZdjP+qqONM79qIm7bDiI4r/seBY=; b=c/hyvT02iWQkGmOD+a0EmzyF8dTQS6F7ug8gptxOum5zrsPpJPPmQ9lJhUUn2CjfrK 2yt6FppiMMC1pxM3fJMcnFBS0weaY1890c6wFvuVEAEPrkI76K16mFHKBAHDgeF5kUGV Jicot8jOkyrbPdk/r1hmYdIQ/YCr2wrot8GRDX8yIlThL6AhnSDtEK9PKAUly7YRwhHs AjFiyyLaIbkockwkMl9D+uyb1qmos5p8PaQanqv0YgvbTqpLDMowMgRuGkot/zVNHaQV J+NPPbQChLpJ8ANrAFn5GeaBPLo3FT4zRVIyEHA470EQnWTa2eu3D0YWB0DIzpVASiTl 6yDA== X-Gm-Message-State: AE9vXwOyNM6pSrQrvROk4jKz/UQ5ulQGrS5HgHqPGZTjDStJyiIMV0Ei67udcii0MaX9rw== X-Received: by 10.66.123.105 with SMTP id lz9mr80234345pab.56.1473226744607; Tue, 06 Sep 2016 22:39:04 -0700 (PDT) From: Bart Schaefer Message-Id: <160906223901.ZM11245@torch.brasslantern.com> Date: Tue, 6 Sep 2016 22:39:01 -0700 In-Reply-To: Comments: In reply to m0viefreak "Re: buggy configure completion - when both --enable-foo and --disable-foo are listed" (Sep 2, 11:02pm) References: <20160830232332.GA23779@zira.vinc17.org> <20160831030055.GC30557@fujitsu.shahaf.local2> <854eeb20-f9b9-f918-4739-82597bbccb1a@googlemail.com> <160901182720.ZM6370@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: buggy configure completion - when both --enable-foo and --disable-foo are listed MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 2, 11:02pm, m0viefreak wrote: } Subject: Re: buggy configure completion - when both --enable-foo and --dis } } On 02.09.2016 03:27, Bart Schaefer wrote: } > I have to update that to look for more than eight spaces for it to work } > right for zsh's ./configure } } Oh, right, I'm missing one #. It should have been '[8spaces]##': } } zstyle ':completion:*:configure:*:options' command $'print -r -- "${$(COLUMNS=9999 ${~words[1]} --help)//\n ##/ }"' } } > and even then it mysteriously fails to pick } > out defaults [/usr/local] and [PREFIX] for --prefix and --exec-prefix } } This works fine for me: My problem turns out to be _args_cache_${name} stashing away the long options, which is problematic for things like "configure" that may be rebuilt with different/new options in the middle of a shell session. If I "unset -m _args_cache_\*" and then try again, it works. } Also, slightly related: } The _configure completion could benefit from my patch I sent back in march: } http://www.zsh.org/mla/workers//2016/msg00674.html In that message, you wrote: >> After parsing the --help output, zsh internally stores that option as >> --foo:some option (useful with --bar=baz) >> >> Later it filters the options using the following: >> tmp=("${(@M)lopts:##$~pattern(|:*)}") >> >> The (|:*) part is supposed to be limiting the matching to the part >> before the ':'. This does however not work at all. >> It will simply use the empty variant and match anyways. Your patch recommends changing (|:*) to just :* and always append an extra ":" so that the empty variant is not needed. I'll point out for the record that zsh tries alternative patterns in left-to-right order and always uses the first one that succeeds, so it might also work to change the pattern to (:*|) [and hope your email reader doesn't interpret that as some sort of emoticon]. However, in workers/39135, Daniel points out that the pattern on lines 266/268 needs fixing, and your change with the appended colon might in fact accomplish the necessary tweak. So I'm going to apply/commit workers/38153 and Vincent can tell us whether it helps him at all. -- Barton E. Schaefer