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, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4742 invoked from network); 20 Jul 2023 05:16:36 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Jul 2023 05:16:36 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1689830196; b=DPE7I2K1g+z11fPRydirlRmAFY6Z0DWPexZ8+36fLGbiGGfVt/bX3bTf0iqI2L4XrKt6iMywYl iI+wc70jKgmEraTtwlawyO3B3Dvj1cYvhTipFrsvXeyHmGp4FPtepIW2z7SW4vZcgDX/IZFgK+ m/FwZvoSusEyAsjGvxmx2VneX73E7S2GLh0z5qk1XTb8jGOKmGMjPZxqIScaKPJjkUfzBxKttF G5oCJ1L75EVZxgd8c1MwklbeBdxVQvkMu37bB4zO6/FtyFclB65XxxlSKm8TAT1irncSoj2/DI XJzdKzdHM8plF10dC5JjXe9Xo+/xHnqo2p+rLtEMwlICow==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f42.google.com) smtp.remote-ip=209.85.218.42; dkim=pass header.d=brasslantern-com.20221208.gappssmtp.com header.s=20221208 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=1689830196; bh=5jeoAHpnGsyNe+mUGc1wleSppRzQkLb4H4pBw51GRXg=; 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=YLlLms2laL565lwXw7qSJnSgOrWDjbMG6t+M6C2BJtY1HslRfguaExCSS813E+m2xD01Rle7Yz zYsT3sxtG1L11ZsaY6B7h2pw05mOJrJSi3g2M3cXqDWx5TZfj4jKaYvAV159IS6H433Alg/t5t ndnb7z8DSavQCqWnpr3H9prZ5wh48MsX2E7vNJhUjiSdwJjtDEnQnQ4KVzkSAG0kj8zvznA41O LNvG/P5XK4yrqB5XEiTPceWQvSVlZGS7F1WLoIdLJ4p4SCU/xD19313pekqFuJ+E1TD6ZeV5GY N8tNTei6ntVoviBrf94/LW9UZt4ttIuaSAdP8qF005dawQ==; 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=5jeoAHpnGsyNe+mUGc1wleSppRzQkLb4H4pBw51GRXg=; b=SOvC+KJmtuAWE34uR+fDIwlgYm 3+LCOZnLEG+CJLbwQ/JaEzdnNXKuGKEP5reflz9j+rtYRrj4ZDYdsO57IkkeCc1R2uOVOapzruHin YrZ7y9hbknELPyaiCEVnReuijt7OPZwVG61t43SUBz5wtFhFZWtzU4YEv5Vr7++VDBWo2DfcNxdY+ EzXfwJeB4Kvh2bDbzHFZ5UFqodVo5dJsvAPa8JIqSrmAxCjvVkFrUXP8F6MUCuM9/2YYQwQ2vAzwt hayWHjYAQfYImi2YOXUXDLAWOUYCUNmrTNjUdTqsBVZ7nHNqVa3m63UXrmSytrFn/LgO0QnRiRuFQ JqNJc2tw==; Received: by zero.zsh.org with local id 1qMM1j-000HrY-0D; Thu, 20 Jul 2023 05:16:35 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f42.google.com) smtp.remote-ip=209.85.218.42; dkim=pass header.d=brasslantern-com.20221208.gappssmtp.com header.s=20221208 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f42.google.com ([209.85.218.42]:47207) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qMM18-000HWm-UT; Thu, 20 Jul 2023 05:16:00 +0000 Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-977e0fbd742so66804266b.2 for ; Wed, 19 Jul 2023 22:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20221208.gappssmtp.com; s=20221208; t=1689830158; x=1690434958; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5jeoAHpnGsyNe+mUGc1wleSppRzQkLb4H4pBw51GRXg=; b=wGBDtz6ioxN3JHQmEcCnm+cai141RVAZJAgYjTL/8rFYxFq95eLFOJCHFtRmtMoAcK izRAoOPNIKNxnR7qGMVP6BVjsL0Lv4+CRAHkzahB5A6d/Cc4mG0yzV7JSCjFuNAo0PZ9 I/n2WV+MUp3Os0pNIc/CclHpQkhWy3jk25oSoksyzkqXVK9h6FFPBJl/dqWEgKgJ610O z85oB3dNT6hh8v7+zyQOc0yZx5J1jXehoso6hv2scgFKEu/5NaOKCwwY8+pkLGy7iuhl hk0rvG1euqQCyf4oDjY01rLHpiBk8SILqGBQVyMr7QIk1wA+QeKARLgnNtDRdphs/Hts /jdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689830158; x=1690434958; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5jeoAHpnGsyNe+mUGc1wleSppRzQkLb4H4pBw51GRXg=; b=XJfscKL/MRMdO29MXGyhDwCZeV/+S+OkzKsNaj5meSRRxJ3w35hVhpMS7dUfSKCXwS PaFbpMu6Mcp/rbCm5FISU1JSLh+hPybNNG3Ag5EGGQeiV6N+9FQY0DHRaIju6tkIa23v NAtOjMijBVAlUMpDZIzvizvQML8pkmnUWkmf0tDN8hQAz3MEzslXO9rPdGY02Q3LrQd3 LHR0tr6ACm5St7k8iUB87yN4sHpsZ2XkFmtRYYqk/lptDKCJKNk9w5jYNbocyql6ZuLa 0BKNmVSnmT1Rcrc/jSYQXAOZrhPW9Gk1lHWMXGPAQHWM98Qg0UnS7xvnvYXO1xwbOoKv 0ZKQ== X-Gm-Message-State: ABy/qLbW1KQEtINns6rxeu6TvCNFmyI9xharzo3W0dn/btYyay+GIugB AI3M600Ti2PguPSOfZqfJk5zH+qJCv3cLYpVW8x9TiEFZSMII7id X-Google-Smtp-Source: APBJJlEmQFfBkS08u4TNcuabU8D8lLvWSimzpTDmfki8S0cfnE9a9jE6PqG/2Ezwl0Yg1PJZinGU0/OrmDC9EHdwOHg= X-Received: by 2002:a17:906:31d2:b0:994:4f08:2bad with SMTP id f18-20020a17090631d200b009944f082badmr3981129ejf.69.1689830158184; Wed, 19 Jul 2023 22:15:58 -0700 (PDT) MIME-Version: 1.0 References: <6bf87a65-1730-8a21-ac5a-d7d05219e024@crans.org> In-Reply-To: From: Bart Schaefer Date: Wed, 19 Jul 2023 22:15:46 -0700 Message-ID: Subject: Re: [bug] Completion functions _files/_path_files -F filter on escaped file names To: Johan Grande Cc: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="0000000000004f4d040600e43e66" X-Seq: 51974 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --0000000000004f4d040600e43e66 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Took me a while to get back to this, went on vacation and veered to other topics. On Sat, Jun 24, 2023 at 12:55=E2=80=AFPM Johan Grande wro= te: > > After looking at your suggestion and other, existing completions such as > _git, I get the impression that I shouldn't use _files but rather mimic > its basic behavior with _multi_parts [...] > If you have any tips or a good example to study, I'll be grateful. > The shortest possible example would be something like local expl # set by _wanted local tree=3D(**/*) _wanted files expl 'files in tree' _multi_parts "$@" -f - / tree The stuff you describe here ... > - complete will all files under a path filtered with a regex or an > arbitrary command > - contrary to _git, I won't have a root dir so if I'm working in a > directory with >10k files under it, I might want to suggest only > immediate children in the first instance rather than browse everything > at once. > ... all goes into how you populate the "tree" array before calling _multi_parts. --0000000000004f4d040600e43e66 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Took me a while to get back to this, went on vacation= and veered to other topics.

On Sat, Jun 24, 2023 at 12:55=E2=80=AFPM Johan Grande <nahoj@crans.org> wrote:

After looking at your suggestion and other, existing completions such as _git, I get the impression that I shouldn't use _files but rather mimic=
its basic behavior with _multi_parts [...]
If you have any tips or a good example to study, I'll be grateful.
<= /blockquote>

The shortest possible example would be something like

local expl # set by = _wanted
local tree=3D(**/*)
_wanted files expl 'files in tree' _multi_part= s "$@" -f - / tree

The stuff you describe here ...
=C2=A0
- complete will all files under a path filtered with a regex or an
arbitrary command
- contrary to _git, I won't have a root dir so if I'm working in a =
directory with >10k files under it, I might want to suggest only
immediate children in the first instance rather than browse everything
at once.

... all goes into how you populate = the "tree" array before calling _multi_parts.
--0000000000004f4d040600e43e66--