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 22933 invoked from network); 9 Oct 2021 16:24:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Oct 2021 16:24:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1633796693; b=jO6d+2k8lAyViF1O9964kDBCmMu3KE2nzW5eoC4KZ2RgqtMe45WgBrhexuTXSidIDmArpNTGkr wps6VyKMJKTDG57RqkeIexXTTL93nlPpZwXBUYDcRc+fAL1D+MLaKH95H2n2PEJiFQgjMH8o28 DSVHAzoZkQTD02+idpf8asyzAu5zSe6cfuoNcScYXrqrBkfmXJo/o8N5atZY89elzG8DUe7iFm Z1ulLYJx8fZ3RMnl4q3osVxiE++R/+mA1W2zBqdc56sV7NB36lDOBu2S8F4Tp0nPyi84eKr8wn sgckVq0TX1Bd2dyx6jSWr85wFpm588BjviQJkw6+q8Xpaw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f174.google.com) smtp.remote-ip=209.85.219.174; 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=1633796693; bh=gYRWFWt/V2SSTv/sSVUMLaikdjOsUq+YKjEuwsHRrWA=; 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=ZSeQVgJApBwc00bgIUULpzF7+7HhdlcbbTtd7I4EHv9UlFzJRUwGdLWUdrWiukhqy+zcKRfN6M FCMtB4ZvvhSaM0quHXbPKJ4GR+CePCXd45kzwILqafs1712tomS417m1RX9rghOgWHwPUdHyNw okr5OWHNBcl681wZzNGu/E0m7z2TcrHyGvFaPFSm6OH5lyV2ZFAlKB5gRanzuBabwIy8GezY/I hVpRqIvUiMudi/BvB0Wga4PqyuBgs7suWKoErUTYzxuOaNh+isjwdRjph4DMBDVtvqXQTYXSEq Ln304IEbTwmDH2Pa9BCozkU7DKvdQYDub5rH+bQYa8sO5Q==; 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=AcskwaZE2D3i43gfFBuhvE3McjfE2slv/sHj6I/Ly74=; b=p9+MfWImxKO/7vtZk3cpsLwl7I N6/qLf1m6RNlL0YhTlvNgk9ASc2BF4suCBqqCEgA6s957a/KGpkaR0rnUGmP4/tNyCY68YYULnFsY E1AcQYGTyRXMriBF+mnD2CGfxE8wQcDtw5rWrIDhfoCIK6xSTdAs/3gaiWgpRc2YVeOT9rdaFkhHd oyX0cctgxWBWIb6M3mqKaKHEFjX/i/Y/UGYs6U8mED0ftXY/g4eIXcncmPEtVHCPafIWStTZ2Dv4l XJ16fAxKiAeRUT8B7Hm+Om6qzHQCLqr3ij1fzIXQP07AhdoRJNpXTZRuqL3MjQ1SGDMV3xyFndWn/ mB95eKkg==; Received: from authenticated user by zero.zsh.org with local id 1mZF9Y-000FK4-1m; Sat, 09 Oct 2021 16:24:52 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f174.google.com) smtp.remote-ip=209.85.219.174; 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-yb1-f174.google.com ([209.85.219.174]:47003) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mZF8c-000EaZ-Ry; Sat, 09 Oct 2021 16:23:56 +0000 Received: by mail-yb1-f174.google.com with SMTP id h2so27922348ybi.13 for ; Sat, 09 Oct 2021 09:23:54 -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=AcskwaZE2D3i43gfFBuhvE3McjfE2slv/sHj6I/Ly74=; b=N0B8OaoV/v/4DryuYPBj4tG7i5N0YUEFtqYdwgLvAurWvaQbzFffsWyA50JMw6XR6D Ewug2VUSXzg0EyqGfHvev0tTRqPP+JBoDHyAk6FBbOuZHJOlkpqDe2wKUyaBLkVyBGjH yctdeuVvGiSm071LPugMiFSDaoQDBnAdPs2keEmYnAQ636W0v/a/UY8bQgmfWaCzjB3o P8uXj+Ckilss1MTawhikzcoPs6gl626qr8EXel7HZvJIajhCXZGUSA+kGT57WBjlgsfp rMMT5MUA0ScgSklx/iUUIJyJU6XdEEdAmMAPLW8hDQ99FFd+KhiSROU3jksRNJAvdTD6 yXQQ== 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=AcskwaZE2D3i43gfFBuhvE3McjfE2slv/sHj6I/Ly74=; b=5sOJmw92EIxDzMTyYJD2MY6u2mUjhyNIetiN/5isgyBSRoXeLagKKK0V/08db+R2Mo ZdeFzuJOcbARD6Ic7v+cqWFd/SI58SD9mvodgg4e32WYF/ACI9hpXqN67i0ayNEN1BzC L+A3JxnBoTviGVT8Kjb/OJXuFvGjz3enhRsabP2LTyqJG+uNH2ufuk6gz5ZgnSgioEnG IduI9qvzBq3dFFKxYkhzObd60xbsvcx1kytV1zllN+Srp/gUdZ5vUdbv+qHx+0lpNVIw vsCKD5qJZ3ySq9Ncdj7wLkO86QycGyHxsXDi/cmJIYrD3wrQmU1oCuZcqjlMT5TuzWxV YnKA== X-Gm-Message-State: AOAM530W8pJAogFJx2oEEkCwdv0T5EibzgavFpulKK2vjH/60E5ypJkU dLGgZUzcvtkFO4j5R2dRquY7Yn4bkkktBOfFETgrpw== X-Google-Smtp-Source: ABdhPJy+chZ8KQOGkQEAevzdUqERAAvyiksaO9z3VxijogLM+4lMMQAsoKDlfw5I3qa876zcXhKprKpXz+h4IWE6Dw8= X-Received: by 2002:a25:bb93:: with SMTP id y19mr11119329ybg.266.1633796633501; Sat, 09 Oct 2021 09:23:53 -0700 (PDT) MIME-Version: 1.0 References: <20296-1632661753.678317@ipjb.25sX.Whnd> In-Reply-To: From: Bart Schaefer Date: Sat, 9 Oct 2021 09:23:42 -0700 Message-ID: Subject: Re: Questions about completion matchers To: Marlon Richert Cc: Oliver Kiddle , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27222 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 Fri, Oct 8, 2021 at 3:39 PM Marlon Richert wrote: > > The way I've understood it, is that, if $word contains the command line string for which completion is attempted, then each matcher should transform $word as follows: > > What did I miss? I think what you've missed is that there are two things being examined: The word on the command line, and the "trial completion", that is, the word passed to compadd that might replace the one on the command line. It's not merely (choosing the first of your seeming duplications) > * b:$lpat=$tpat -> ${word/#$~lpat/$~tpat} > * l:|$lpat=$tpat -> ${word/#$~lpat/$~tpat} Rather it's * b:$lpat=$tpat -> [[ $trial = ${~lpat}* ]] && ${word/#$~lpat/$~tpat} * l:|$lpat=$tpat -> [[ $trial = *${~lpat}* ]] && ${word/#$~lpat/$~tpat} In the cases with r: and R:, $ranchor is only compared to $trial, it is not used when replacing into $word.