From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id dfec5a2f for ; Wed, 18 Sep 2019 20:38:58 +0000 (UTC) Received: (qmail 2061 invoked by alias); 18 Sep 2019 20:22:18 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24258 Received: (qmail 20325 invoked by uid 1010); 18 Sep 2019 20:22:18 -0000 X-Qmail-Scanner-Diagnostics: from mail-pl1-f195.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25573. spamassassin: 3.4.2. Clear:RC:0(209.85.214.195):SA:0(-1.7/5.0):. Processed in 3.979314 secs); 18 Sep 2019 20:22:18 -0000 X-Envelope-From: rpigott314@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.214.195 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:in-reply-to:date:subject:from:to :message-id; bh=zhRTnXN5W73QseozXKG81AC07m+vEhiVoDkmTJApCpo=; b=nnn7VzxAWPBc6nw+SbvIN6MRZEaEtDjNlZfrBfeCorWa3a/ifN0L2pY4yL75b1NSP5 BqXMIXDnT6LLusJrXISHmEyBRf/0Pma+EHAjzbZJDxA7SNElxsWH0oFQY2QCf+O3qgt7 uoVmgLFVpy4W5Z7ZlNWrY9rR4+S5jZLSwt7luCPK16bKGyo6JKf2oi4+PR3z92cFpByI sw1m0w0Cm49Ii7OAcxCpq4+53mD7eHqI27Qi8K65aJ//Y47JsSOVBv4+qxvyyJRU4v0J bDfOl11GSI799pokZu45aQa2akxINTdG99Os5pWoonzwJSR0O1clSZNSFEq3Q7db3D8+ z5Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:in-reply-to:date :subject:from:to:message-id; bh=zhRTnXN5W73QseozXKG81AC07m+vEhiVoDkmTJApCpo=; b=B2nFAWgS/ZU3sabeADRkrgJyyXkQVq5XdbbrUN/wUdUra/T6K8X/POAYbYW2NLklfs fHMleuqW7a8tWjIx5j1eMjmI5rEd52qDDd9N6vnsbVaxWylXLA5/zLFfqmI3wQh1b5Jp S0N4Pj68Hru+/N7O3cQx3d+TTKmCGJpn1e571q58osNUX3LtsaLiU4QHy3IQF+Pp29IR +2vf7GtTNIgqXWXxTya5Z6x3GO0nE5fCTrsDxgouS36cxNbohLzLvzpV3snhbidg0DMV jywiBZjpFLA3nBNU3k12ctsZf8PJ629qslGCvepdlUeEW2so08bDkOu8VGFq+FirryYL EsLQ== X-Gm-Message-State: APjAAAVqCv4JCo6XTUK3s0jn4JWEtcV/kIA9jHBfZzG8p/jE67Yf6P+7 Ql5SUWqfcsM2CtUhlyMVOga0T1k= X-Google-Smtp-Source: APXvYqxlI9bPyMqjJgAqV9Wo/DwPazGujhu5+0Oo5w54V5pFZQjTyl27fY+C2mQfznyGZypdw9U6Mg== X-Received: by 2002:a17:902:8d8e:: with SMTP id v14mr6089741plo.33.1568838100356; Wed, 18 Sep 2019 13:21:40 -0700 (PDT) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 In-Reply-To: Date: Wed, 18 Sep 2019 13:21:38 -0700 Subject: Re: Possible to use _arguments with _regex_arguments? From: "Ronan Pigott" To: Message-Id: X-Qmail-Scanner-2.11: added fake MIME-Version header MIME-Version: 1.0 On Tue Sep 17, 2019 at 7:31 PM Ronan Pigott wrote: > One thing I thought to try was set '{words=3D("$line[@]"); _myfunc}' for > the action, but it did not seem to work. >=20 > If it cannot be done, is there another way that I can transform the line > to be completed before running (or re-running) the completion to make > this idea possible? I've since found that _arguments itself has the ability to transform the words and CURRENT special parameters by specifying the argument like: '*::message:action', but unfortunately it still does not produce the desired result when 'action' is a function generated by _regex_arguments. Can anyone explain the behavior I see? What I observe is that when _myfunc is created by _regex_arguments, and the command argument is passed to _arguments like so: '*:message:_myfunc' `command arg1 arg2` is completed correctly as expected by _myfunc `command -o option arg1` is offered no completions by _myfunc, as it does not match. When I use '*::message:_myfunc', completion is no longer tripped up by options, but _myfunc always acts as if it is completing the first word for all normal arguments, as if $words was empty and CURRENT=3D1 even if there are many normal arguments. I'm looking for a way to have _myfunc when invoked as an action of _arguments see only (and all of) the normal arguments, but for some reason the _regex_arguments functions don't seem to behave that way.