From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21763 invoked from network); 22 Sep 2021 23:26:40 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 22 Sep 2021 23:26:40 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1632353200; b=XP0raIvk0w+QNWT1MTT0pZdm/2gIid8uQfZOgqszlyYzsb2wQCaQJdRFz51gy/d6/3ZElo3EgU Nyl3G4Ygo8pgX7+h3jG56OraAEYmMJ/ypOGnJzOowV2W4PTyDrgCx6sjjUEYd/fFLj89+nkpyf fr6N/SkpOFh5gHs6BMl5Mmdf6gF7bx45ixCbrkH2dlG7BzhSPx+eCGgFTOQEKo3sIXiTLlNWwU zdU/8yq5En0IPKUsSf+40Pi1liOIAgNC2AtfX1qH4gelLJzU1nhFtsKoVv0pTWTsz4+fvbz/xm cr3ZW351X6rnbRNc37kh8bIubYXda/Qi81XWyHHA4hq1nQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qk1-f181.google.com) smtp.remote-ip=209.85.222.181; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1632353200; bh=yKRZatDvv4BXJRpvAg0QmclkiVe37oCVdxY3h6heGQk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=HcZ93XyiWcF0ed0wvrUb7JTtVxxnkK4hQSw6LYwpzzF3AW0JZjzhxHXWxKVKqIY1S344wCVJIJ DvAyHxzyuKMv6YIcY4CAobQhXzLUkGTXRwC3ZXr8OA6P8J4HfDTLC6KO66JBSOfNrizaPojji5 YJ3Mv+rzLynIqqupnvanF1BuXHUUnUeasroa0TzGl4B7211QLz6qgGt7TpNqWKoN24QV3o+/0F 8MKNKcwOVordeO/efKTgdm7EGkzAKaeVflqRwjXzZ5FeyCs3qLgOHK0gRIPg4hG43Mo1cUD3B7 L+mPJg7OvZMiuxDD8j6L9wp4OXqCNNLN6t2p2kMBQy12SA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=RudiETr3X1G3tSyGAMiXmjyBZL2JiIy2XSm5eReDKHM=; b=rVXao/pOueyPVC8wu2hdvQOnCC dx6mCShAilYHtqT3oDZzK3vcTzxohYbH/KdneKkWnyHA5G5idBl+OU+w8zeCb/Z7dQr89F6piCHq3 gdy6jwoZFPfsC2i+BrH49Nf0AlYS07CYLnXZIqzAFLYIKjpQzyrIpMWGPLv8pRuoFiSuD4G2QdGu3 lxmhoD0mmOaef9p8e+woNVU6y1DglL21oLr0lVDLQyVOPKXfAP6zqF1GWq1pmVXl7R92/VDKyz8dp 8YXc+X596/NTv3DF3+vNLguq/RcBQaI46YNjftdInCVRCVY4VGdP2RykG0yIzeWMs3SAFtK3ILvz8 DvaVdFDA==; Received: from authenticated user by zero.zsh.org with local id 1mTBdP-0001ng-A0; Wed, 22 Sep 2021 23:26:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qk1-f181.google.com) smtp.remote-ip=209.85.222.181; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-qk1-f181.google.com ([209.85.222.181]:45995) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mTBcf-000157-PT; Wed, 22 Sep 2021 23:25:54 +0000 Received: by mail-qk1-f181.google.com with SMTP id q125so1129078qkd.12 for ; Wed, 22 Sep 2021 16:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RudiETr3X1G3tSyGAMiXmjyBZL2JiIy2XSm5eReDKHM=; b=VVVutz/xsB+Oc19gjriEKnqAZFH8qqeGaFNVzs+ZFHEZgYHL8xGNXEZq1EGy5b3HRZ Trx8mcW5Pmf44PAgNVqQHI7o5BJqJppWFT55LYqh70Acd255XGSwZqwJf9ygIXd9oUG4 slAtpOeVXa0yn5dX/SjXzGGU9Z1VP536Z1Ypn2FFcz06BtX1edpbvPan42Xp2ZFzw2HR Jf0TdUVJEmKF/lUjbfejGlv4yTS/v7gD4tPDhfdLAh29l7cjUfqF4mIvybT6GysGR7bW YjCTCXEUXFguCSVEMQfcqCBz/WGAntrJ/r3IrijOxqkTTm8bkNzxscuqvafYcjkNABEK L9HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RudiETr3X1G3tSyGAMiXmjyBZL2JiIy2XSm5eReDKHM=; b=zNmFPhpGxp5CUePoZkbRzrjgDQcjJTBFDG9q0xHmt+VcF3bbT+knLsb2Rr/zR2L5A8 mC4N2ZrYnq5JazKYRd3AUu4LFjBrcGYjMWiw9MDbJxUTAnLEQQiOlFuQBbcChqD+eSEt 9SgR06HiSPRmQZeMu+1B4sZ3iwA3ocqqORwhGvmPaN+o7ef8H1OlAiEMbZZ1YAoHC0yt MUP9CjR5Ny+tpVuitU7VbV6AKrFvcUgAUaXlvOzWRjE7/OGHJolTMw6T5xkmwioKQD5I Etc14zK4Dhx7uMw0VIJ3CQooisxFRTQLyoI1Y5ToIyzyYBdoL99YjBAoV+/mUluEetzj hEGQ== X-Gm-Message-State: AOAM533lg5wFUnzSiYDPK9drC653G8fSpUgQon2KRXr6mS8zvdhXy2K+ WawGPT+Bir5yRxTBJg53YA3H6N1S0E5Owz0TNi46yQ== X-Google-Smtp-Source: ABdhPJxsRvPFt5c+qS0UsPCw/nS8riNrUTg+qeAqdvppbns8m4jQbiFZKFiC1TBJfFYXhKHP+uznkqBPfNBxVcYLc4s= X-Received: by 2002:a25:7e46:: with SMTP id z67mr2056478ybc.166.1632353152562; Wed, 22 Sep 2021 16:25:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Wed, 22 Sep 2021 16:25:41 -0700 Message-ID: Subject: Re: Questions about completion matchers To: Marlon Richert Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27130 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Tue, Sep 21, 2021 at 2:23 AM Marlon Richert wrote: > > How can I make a matcher that completes the right-most part (and only > the right-most part) of each subword? I would not try to do this with a matcher specification ... someone else (Oliver?) may be able to give a more accurate answer, but I don't think matchers are very good at splitting up words unless there is an anchor character ("." or "-" for example) to subdivide the words. I know there's an example that purports to handle a similar situation, but the more you want to constrain it ("only the right-most part") the uglier it gets. Instead I'd probably write a completer function that creates a modified words array using match-words-by-style, then compset the appropriate prefix and suffix. But I haven't gone very far down that road. > * What is the exact difference between l:lanchor||ranchor=tpat and > r:lanchor||ranchor=tpat ? Again I'm not the ultimate expert here, but "lanchor" always has to appear on the command line and with "l:" it has to appear to the left of the matched substring (but not inside it) and with "r:" it has to appear to the right of the matched substring (but again not inside it). In both cases ranchor has to appear in the potential completion result (the "trial completion") but might bound a range on the command line if it does match there. In practice I've nearly always seen these to be empty strings. > * Why do the examples in the manual add r:|=* to the end of each > matcher? This appears to make no difference at all. All of my real-life uses are "r:|=**" ... I don't know the answer to this one. > * How are the match descriptions inside a matcher evaluated > and what causes the difference between these? I believe they're applied left to right and each one constrains the possibilities seen by the next, based on what's already on the command line when you invoke completion.