From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1745 invoked by alias); 11 Oct 2016 21:34:16 -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: 39611 Received: (qmail 25980 invoked from network); 11 Oct 2016 21:34:16 -0000 X-Qmail-Scanner-Diagnostics: from nm29-vm7.bullet.mail.ir2.yahoo.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(212.82.97.76):SA:0(0.0/5.0):. Processed in 0.335168 secs); 11 Oct 2016 21:34:16 -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=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.mail.yahoo.com designates 212.82.97.76 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1476220842; bh=ItwR9ToYCk1AQZxQKpPOyhzrSB4/XaWpf+fMtvPCg/w=; h=cc:In-reply-to:From:References:To:Subject:Date:From:Subject; b=IodLlkyHfyTnB+KGeMcjtsAo9rUaK9N69s1HDqV9oMNPOHC+UfljkC8rXa5LV0yb/G26FVCR5OLOSrRxGckW9wDqhyAjTNzwPPl2n7E70M5gCFZiGU5vVl8LLT9/evKUm6QBQb7F8FJzbTUVM7kiDDu8lpg3fEFJWxnoN1GJ6OUArTNmPNA6StfJJgEwF7hWdeBTxYsn01ak4eGWimbGVyGtWpbGHtriCGNZFC+OKpaMqsSRzwfglfZucjiK/nO2DGehFfjlw27y0oIClpELb96xO+qKHUnnJDtcR1rGggOoS16FYSBkfRV3/liBjrs44JgxMag/8G4rZyoin4pNQQ== X-Yahoo-Newman-Id: 928760.36828.bm@smtp118.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: gHgBKZ8VM1lNvasYqs7CUkDxbl4IKUMgtR5blX6jy_MFTpK 7CihCSCgOgf71bE576Nn2SWRY0P9OBVl57ShMGrb7zKA79kHmrL4UXAC5HO7 osDcu7DgOlz5mHxwm59T9Za88Sa0g9kKgIDTiTlYoz._MzAr1uzC5w91l31L kvEPTX4pg_vcgltYhulNXbfDFNyVwAe8wkry3rW94tDLBK8B9ckRJrqEA1DI 1IFBcOMbMv9RumlVEe5Pbvo0W.iNmKSo0YfkwrC3ULEAJjqaEy_JWNKChnkr ZMtBushIk1125.WGHshvTTNPODLucrRgb3MtJlGMWET1.Dup5GWo5YE0q6uk gZips8xT3n16IAuOix5EpeA58_1gFHkOx_qZrQsq4fvSfqGqus3NllSU2JYs 3oDR17ME85u9yBmyPqUW_CfMUKHP65MtpUUdHDe5Ri2tAYrsLkqXhZFQZxH4 jP9dzKSAyagwCHhJxbyi0DKa.j4mYlXTdW5Ruxd_kTrYg1MVlU60JXSS3YMq OzyWZBdNVdtBvULArXbGA20VD.rKpre.AlJl.7MKKEw4- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- cc: Zsh workers In-reply-to: <20161002174320.GV49062@isis.sigpipe.cz> From: Oliver Kiddle References: <20161002001931.GA686081@isis.sigpipe.cz> <14379.1475371914@hydra.kiddle.eu> <20161002174320.GV49062@isis.sigpipe.cz> To: Roman Neuhauser Subject: Re: completion implementation woes MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <88313.1476220841.1@hydra.kiddle.eu> Date: Tue, 11 Oct 2016 23:20:41 +0200 Message-ID: <88314.1476220841@hydra.kiddle.eu> On 2 Oct, Roman Neuhauser wrote: > why does '*::' pop $words? *:: removes all recognised options from $words. *::: would strip it to just arguments corresponding to this spec. > is there any chance to get the - thing working with chained _arguments > calls? this seems to be the least-clutter notation... Try the patch below. This makes it check if the word is a recognised option rather than just seeing if it starts with '-' or '+'. I've not been able to really establish what purpose the whole condition serves. When it was first added, the sets notation didn't get too much use because it is slower, requiring multiple parses of the command-line. So bugs are less likely to have surfaced. > in fact, i'd love to get as close to a grammatic pov as possible, There's also _regex_arguments which is closer to a grammatic pov, though use of it is more than a bit messy compared to plain BNF notation. > and the more faithful the representation the better. eg. activate > does not take any operands, so the '*::option or operand:..' rule > rubs me the really wrong way. You don't have to have 'option or operand' in there as a description. Use a single space to leave it blank. Oliver diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index e9bad1c..cb3c32f 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -2158,7 +2158,8 @@ ca_parse_line(Cadef d, int multi, int first) state.opt = 0; else state.curopt = NULL; - } else if (multi && (*line == '-' || *line == '+') && cur != compcurrent + } else if (multi && (*line == '-' || *line == '+') && cur != compcurrent && + ca_get_opt(d, line, 0, NULL) #if 0 /**** Ouch. Using this will disable the mutual exclusion of different sets. Not using it will make the -A