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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19101 invoked from network); 31 May 2021 07:17:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 May 2021 07:17:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1622445421; b=ugEkqQBgBjfsIE/a5B4C2y3oLekU61q/8NgQP64RKs6/ISAbGwzg5kLeGitd7WdDQFbqyKugHc rmwZtl5QLw25XUb0XXKZi0EmcpcSsgQG68S5x239bHZvDCpfpEBpLlBDfWdq9xQZo/zCqEjgRG 9DUtGBRjx8igJDwfeqv0KeIEonKjkE2ZlXZ+U42Hd/T60EYkotI+l0cq37tp11BwWcCz7PVY8J oxQwaP/fEZQNazjDG4PUbhWwfll+BtA2Kdmok78vs5R1izkfgGRA7durXmZuP2l8NVGnEKZZxs dC+Lndr8dUPwD2ieRUjdSXUCt5JYoU2lRAPdiu7g1uFPCg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pl1-f181.google.com) smtp.remote-ip=209.85.214.181; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1622445421; bh=G+VN0RiTktahHtyKLAfYmRHpnb+3LlsAbsP0ps1uTl0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=Hk9qwHkKRlUXoE6L1Jp/8bjgXbiTSImOezqXc3GKedF5r4s11u/6/9RDoFcKDRhSvLpxhMngMz 1JE77yy2sxj1fw8EWmXdT7Lq4RLc+L3R9jrLAIXCbepxqlNIdMtsXfh5gBUhj8LeA/eAhcjXiw bgql2sTl0tiQykyKGrNnZtQyJW2IVnXWtZmts/K0oGPMTMExxOc/WI5LPjKSEW6/cslP62C80L v7zhH3ejDFtP+Pg4grlX4sjpQbDBmdoZyYvfg7OSaZrCWzqq63/cgeRkEbJitVlNr2zsNYUZ7g wlrNTEwhqsec4QbrCA3Xtk0soPkbcc33V1WvrgNbhBH2nA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ZWO29fdGGwKVnchv6QZiAf0ii1Z7u4WVQ9UWfXmDRbI=; b=VN7pC/iux0Il2BIAAlUQ+WPgiT q7ThCTHDUiRDDSqfM1haT0SpiwHpsFmA5WcZ1ZVGggCGrfldqkhRXQRWIQynheqGVv3GzkHC8wx// jyBVkt0y+M+h75o1BF2+AyHuNenk6YsBDXmrVfuOLEpCU9w3kICjswIYZnR3WyakUwCBg3C3m7j1u R2GecwIArh4cZH8jLRXiclb3e1BtJDWZAAj8Dit7pfr8/3YnUFRynt33NzgnTwzL3tk2MUqSsAO9u Nbx34RYlK3EkH6nZDkOMzvrr4ursutiL4TMrvR3CEtfC9sGxdLaHkxYzOS6Ag4p2sxOz+3jcWalCY m33zaAsQ==; Received: from authenticated user by zero.zsh.org with local id 1lncAU-000EFB-8e; Mon, 31 May 2021 07:16:58 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pl1-f181.google.com) smtp.remote-ip=209.85.214.181; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pl1-f181.google.com ([209.85.214.181]:35332) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lnc9k-000DWv-TD; Mon, 31 May 2021 07:16:14 +0000 Received: by mail-pl1-f181.google.com with SMTP id t21so4768765plo.2 for ; Mon, 31 May 2021 00:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ZWO29fdGGwKVnchv6QZiAf0ii1Z7u4WVQ9UWfXmDRbI=; b=ue7lR6JvSBmgwcnl2V5eEhfW5uxci+GTxGFCshNjvf74BJ7HRYYJq0nkumad8S7t1p udN351C8v4EuNxueyadLXHBgqE8jklJkluFwCM/ouPBCoNIfe55eX4CarcY1OBT6Bb3z eXXoYlVQd8SfmvXDKsOdf6JqKs/A/Mp4+pf/j0jeFJSje5t/RExF7jSojRyySuO7/XEf x7R5W8i3Z4EGNoFXsLKgZ6tZp7EiY4h/4xl2vS/b/XkfEGO1NO2++MYhv7aORlAD4sZL 6kxzGBEqUZ4ZHJJt8xt8ON4S4UcyTrGoLN1CUGKUAKFl5Bva7rbnHvFO84ANlAXQGcn7 FNkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ZWO29fdGGwKVnchv6QZiAf0ii1Z7u4WVQ9UWfXmDRbI=; b=QeavOpualEy5Zp0khq3aQu50Rqrh3Xneg7tDlIt9+n+uEh32JIcnbACkuZTFmUhom7 InnSN+4TVU7MUvLYoboGnIJg3y0n9PVAZ7S26gHRMZG8Ihf1D1sMxPvPSRPu01z52+r3 xOmA3AmYmAhyJn3TIDh1Vv53wOgCwWP0oqkSglLiz0e2mOeXgbwskdFvdhjvZaMiS0Pm Fqbpn/GJbugEfS6T7vcnBiXvKbb06+IzrdIb+MVktLscSJjZb3bLZd3yC7QPK+O5j/Zc or6shCpluATPvh7mkWp0OZH8R9RS3tn/Gow0S01w2Y8OFYrsrYrglJSlQVL9OeENg9vz AUAA== X-Gm-Message-State: AOAM532+cFOvVvVE+bFgkNPNnbLEv6jMYyk1Z6ZLbeUuOKvzMOl5nrDu +jI3yNkib6carhs1OBmbdrRlKhGR5MtcyNy50htt9LmzTvw= X-Google-Smtp-Source: ABdhPJx9v3VRnXlm3CxkcS0OyszF8qkI4O0QxuG1WAinq1JGDrbHTAAHQZz5WDSYsD/fSgmqTd8omCNkSbhvDYnmA7Q= X-Received: by 2002:a17:90a:4493:: with SMTP id t19mr17827880pjg.217.1622445371017; Mon, 31 May 2021 00:16:11 -0700 (PDT) MIME-Version: 1.0 References: <86341-1622379181.040384@EIIb.SjlL.3aYW> In-Reply-To: <86341-1622379181.040384@EIIb.SjlL.3aYW> From: =?UTF-8?Q?Fran=C3=A7ois_RONVAUX?= Date: Mon, 31 May 2021 09:16:00 +0200 Message-ID: Subject: Re: Completion does not work with hidden files/directories To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="00000000000001cb0405c39b00c9" X-Seq: 26751 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: --00000000000001cb0405c39b00c9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Oliver, Thank you for your reply. Le dim. 30 mai 2021 =C3=A0 14:53, Oliver Kiddle a =C3=A9crit = : > Fran?ois RONVAUX wrote: > > In my home directory, there are currently only hidden files/directories > and the > > completion mechanism does not see them :-( > > The main way to control which files are included in file completion is > via the file-patterns style. So if you always want to see hidden files, > it would be something like: > > zstyle ':completion:*' file-patterns '%p(D):globbed-files > *(D-/):directories' '*(D):all-files' > > (D) is a glob qualifier that includes hidden files and you might use it > from the command-line as, e.g. *.png(D) > > I was going to suggest something like the following which adds the (D) > to the all-files fallback: > > zstyle ':completion:*' file-patterns '%p:globbed-files > *(-/):directories' '*(D):all-files' > > Unfortunately, _files has some sort of shortcut where it does: > > [[ "$pat" =3D '*' ]] && return ret > > So it never tried all-files if globbed-files was using * as a glob. This > should perhaps be looked into and discussed on -workers. > > What you can do, however is add a second run of the _complete completer > with the separate file-patterns style: > > zstyle ':completion:*::::' completer _complete _complete:-hidden > zstyle ':completion:*:complete-hidden:*' file-patterns > '%p(D):globbed-files' '*(D):all-files' > > Note, however that you likely already have a completer style with other > functions like _expand listed and you should only add _complete:-hidden > to the list somewhere after _complete. > > > Same issue when I want to change of directory : > > cd doesn't use files so file-patterns may not help there. > > > zstyle ':completion:*' cache-path ${ZDOTDIR}/zsh_cache > > zstyle ':completion:*' use-cache true #on > > > Second issue (less important) : the section "Create a cache" in the > above file > > does not work. > > Only some completion functions need to create a cache. Note that those > lines do not create a cache, they only tell completion where to put cache > files. Is ${ZDOTDIR} definitely set to something. If not, it could be > trying /zsh_cache. The directory you specify should already exist and > should be a writable directory. > > Oliver > --00000000000001cb0405c39b00c9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Oliver,

Thank you for your reply.
=

= Le=C2=A0dim. 30 mai 2021 =C3=A0=C2=A014:53, Oliver Kiddle <opk@zsh.org> a =C3=A9crit=C2=A0:
Fran?ois RONVAUX wrote:
> In my home directory, there are currently only hidden files/directorie= s and the
> completion mechanism does not see them :-(

The main way to control which files are included in file completion is
via the file-patterns style. So if you always want to see hidden files,
it would be something like:

=C2=A0 zstyle ':completion:*' file-patterns '%p(D):globbed-file= s *(D-/):directories' '*(D):all-files'

(D) is a glob qualifier that includes hidden files and you might use it
from the command-line as, e.g. *.png(D)

I was going to suggest something like the following which adds the (D)
to the all-files fallback:

=C2=A0 zstyle ':completion:*' file-patterns '%p:globbed-files *= (-/):directories' '*(D):all-files'

Unfortunately, _files has some sort of shortcut where it does:

=C2=A0 [[ "$pat" =3D '*' ]] && return ret

So it never tried all-files if globbed-files was using * as a glob. This should perhaps be looked into and discussed on -workers.

What you can do, however is add a second run of the _complete completer
with the separate file-patterns style:

=C2=A0 zstyle ':completion:*::::' completer _complete _complete:-hi= dden
=C2=A0 zstyle ':completion:*:complete-hidden:*' file-patterns '= %p(D):globbed-files' '*(D):all-files'

Note, however that you likely already have a completer style with other
functions like _expand listed and you should only add _complete:-hidden
to the list somewhere after _complete.

> Same issue when I want to change of directory :

cd doesn't use files so file-patterns may not help there.

> zstyle ':completion:*' cache-path ${ZDOTDIR}/zsh_cache
> zstyle ':completion:*' use-cache true #on

> Second issue (less important) : the section "Create a cache"= in the above file
> does not work.

Only some completion functions need to create a cache. Note that those
lines do not create a cache, they only tell completion where to put cache files. Is ${ZDOTDIR} definitely set to something. If not, it could be
trying /zsh_cache. The directory you specify should already exist and shoul= d be a writable directory.

Oliver
--00000000000001cb0405c39b00c9--