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=-1.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,T_KAM_HTML_FONT_INVALID,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27790 invoked from network); 26 Aug 2020 11:29:00 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Aug 2020 11:29:00 -0000 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: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=yuQveEYC4C/HAGdTOs5UEZGoj3pAICq+I98or1xcUyQ=; b=qUzngZmikNWsRRB2gd6fEmf/lf eSqqj7zbtSWREmhIxt2/kJ4ZaWGQGAnB+bUtFLiiAgvWMP6ufoFTjKv44tB9tK+ZN2K/MAJkFutT1 vdZpbh1uruQeNgwxv12oIePXzifBkQgrkZYJFcFhYyDqsyNt/LyJRnKau1EmE1Ng1FQ4rET4dxOnA URVHG5uNZ2v35pv4oj/SUVuz0PAUPeiys29noUuDAKv7bxM87HaCQBpVHDc6TP66FWURhH3JTbE/4 /SXROdkr42H+BwIQPnFgxUpGjh0oAoLl31P03TsATrgg/HkB0sa9cUdHQzqUKXVF8BSvqpVI6CEvu epNAEFZA==; Received: from authenticated user by zero.zsh.org with local id 1kAtbs-000J43-UC; Wed, 26 Aug 2020 11:28:56 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f52.google.com) smtp.remote-ip=209.85.210.52; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=skipped; arc=none Received: from mail-ot1-f52.google.com ([209.85.210.52]:41572) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kAtbQ-000Igv-I5; Wed, 26 Aug 2020 11:28:29 +0000 Received: by mail-ot1-f52.google.com with SMTP id a65so1182544otc.8 for ; Wed, 26 Aug 2020 04:28:28 -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 :cc; bh=yuQveEYC4C/HAGdTOs5UEZGoj3pAICq+I98or1xcUyQ=; b=oROTC+wcIR94ueMUScRC2twtlbDw9yamdreiUs4xolO1pU5LnRYrHUBRtxeSQJkHnC w3n9BLDreC3U7l13sAOZydYdyrFkJvZ7x77XvvGADO/F5qJOZRhssxh4ZlVdnTKk5FfP 5z0SDgZ0SzAMF+OyWVEGdaWnmCGy4IsyQ0Jxaiup6wucjMJPimUB4fLRmRL13W2ympXj QBqW43PyMOw1C2qsJm01DuBdM5oX8qZY+G2LJItHjtmgjyqLUuMNBhS3mukOmb6O6FyX NWWo48EOUU8uZ2BVvh8LQrIS4VKDjEWom5QbhIyrZJnEGGMnDR7JikYxosVx5g0S8L61 vfNg== 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:cc; bh=yuQveEYC4C/HAGdTOs5UEZGoj3pAICq+I98or1xcUyQ=; b=NhmF5B6cUH6ZxMa+7QS72V2N70ukqC5cC912MY/A9brkrKK5JpqfXPpfXuViQy4atg efZXLf6zwauzL3GxQqgU7VlzRYDMpCpjZKqZQSqcl1PwP9ISg6GoLvsCurMt8/bbjUio 3Bb3vlUxETNHWdAI8eBLVlByA5p82PqZJBskchwHGrCAhmS10XpaHxK7BS7oZjjKxpXS 61mQBYzFlUH16sRimkPN+A1C6WzlTSW8SRFIu2RMaduxRaXNx3nOYgF00BLQQ1LhWoc1 Y/EAbZ0qH3NTv1RaFFcFNvDgcBPjCrN05qosB9JlX144iFiB9stUwVvOcQaqiqfktA96 IOQQ== X-Gm-Message-State: AOAM5302vBtCPYtEdRRCV9uqNI7NPcRiu0DKeIoVZaLAMWbLb60C4OY6 GK2zTlRYBkAClljGct4n69zGesXWjyVu5rB+0Lw= X-Google-Smtp-Source: ABdhPJxWDAF8GV/+zy8MeZIrAw5098PrPAPdg8OVQPjoQEpLaKTzbx/eBuuL6Pit2k+8bGv3pwz5vYR/OhxUoAQaJ7A= X-Received: by 2002:a9d:942:: with SMTP id 60mr9414810otp.32.1598441307156; Wed, 26 Aug 2020 04:28:27 -0700 (PDT) MIME-Version: 1.0 References: <441849700.1433895.1598439442873@mail2.virginmedia.com> In-Reply-To: <441849700.1433895.1598439442873@mail2.virginmedia.com> From: Ahmad Ismail Date: Wed, 26 Aug 2020 17:28:15 +0600 Message-ID: Subject: Re: how to use tags in zsh completion system To: Peter Stephenson Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="0000000000004eb75805adc61e1c" X-Seq: 26034 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: Archived-At: --0000000000004eb75805adc61e1c Content-Type: text/plain; charset="UTF-8" Hi Peter Stephenson, This is the first time I am using a mailing list. So, I am not sure whether I am doing it correctly or not. Do I need to always refer to my previous mail or will you be able to figure out my previous mails? Do I need to view my email and its correspondence from https://www.zsh.org/mla/ or everything will be in the inbox? Being said that, I tried: % scp tags in context :completion::complete:scp:: argument-rest options (_arguments _ssh _ssh) tags in context :completion::complete:scp:argument-rest: files hosts users (_ssh _ssh) globbed-files (_files _ssh _ssh) hosts (_hosts _combination _ssh_hosts _ssh _ssh) users (_users _combination _ssh_users _ssh _ssh) % scp hosts tags in context :completion::complete:scp:: argument-rest options (_arguments _ssh) tags in context :completion::complete:scp:argument-rest: files hosts users (_ssh) globbed-files (_files _ssh) hosts (_hosts _combination _ssh_hosts _ssh) users (_users _combination _ssh_users _ssh) I am sorry, I can not understand what the output means. The documentation says: "typically indicating a class of object that the user may need to distinguish." "Unlike the contexts (which tell you how completion arrived at the point it did), the tags describe the things it can complete here." If you will be kind enough to explain with the example you were talking about then it would be very helpful for me. If you kindly make a completion function with more than one tag (Ex. frooble1, frooble2, frooble3) and description of how they were useful. And how that function can be used with `zstyle ':completion:*:aliens:*'....` then I will be very glad. *Thanks and Best Regards,Ahmad Ismail* On Wed, Aug 26, 2020 at 4:57 PM Peter Stephenson < p.w.stephenson@ntlworld.com> wrote: > > On 26 August 2020 at 09:59 Ahmad Ismail wrote: > > The [documentation][1] says > > > > > zstyle ':completion:*:aliens:*' tag-order \ > > > 'frooble:-funny:funny\ frooble' frooble > > >which is used when you're completing for the command aliens, which > > presumably has completions tagged as `frooble' ... > > > > I understand that both context and tag can be viewed using > ^Xh. > > So, I tried the following command but suggestion did not show the tags. > > > > % zstyle ':completion:*:aliens:*' tag-order 'frooble:-funny:funny\ > > frooble' frooble > > % aliens TAB > > Completing file > > Desktop/ Documents/ dotfiles/ Downloads/ > > % aliens ^Xh > > tags in context :completion::complete:aliens:: > > globbed-files (_files _default) > > % aliens frooble ^Xh > > tags in context :completion::complete:aliens:: > > globbed-files (_files _default) > > > > I think I am doing something wrong with > > > > > completions tagged as `frooble' > > > > Please help me understand how to use tags in zsh completion system. > > Hi Ahmad, > > That section in the guide is actually just an example of how things work > using an invented command --- your understanding is basically correct but > actually there is no "aliens" command. > > Just off the top of my head (other people may have their own favourite > examples), one interesting command with a number of different tags > that apply at the start of completion is scp: ^xh for that gives me > > tags in context :completion::complete:scp:: > argument-rest options (_arguments _ssh _ssh) > tags in context :completion::complete:scp:argument-rest: > files hosts users (_ssh _ssh) > globbed-files (_files _ssh _ssh) > hosts (_hosts _combination _ssh_hosts _ssh _ssh) > users (_users _combination _ssh_users _ssh _ssh) > > so that might be something to play with. > > (Alternatively, if I got my act together I could probably write > a fake completion for "aliens" that actually did what the guide > says...) > > Cheers > pws > --0000000000004eb75805adc61e1c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Peter Stephenson,

This is= the first time I am using a mailing list. So, I am not sure whether I am d= oing it correctly or not.

Do I need to always= refer to my previous mail or will you be able to figure out my previous ma= ils?
Do I need to view my email and its correspondence from = https://www.zsh.org/mla/ or everyt= hing will be in the inbox?

Being said that, I trie= d:

% scp
tags in context :completion::complete:= scp::
=C2=A0 =C2=A0 argument-rest options =C2=A0(_arguments _ssh _ssh)tags in context :completion::complete:scp:argument-rest:
=C2=A0 =C2=A0= files hosts users =C2=A0(_ssh _ssh)
=C2=A0 =C2=A0 globbed-files =C2=A0= =C2=A0 =C2=A0(_files _ssh _ssh)
=C2=A0 =C2=A0 hosts =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(_hosts _combination _ssh_hosts _ssh _ssh) <= br>=C2=A0 =C2=A0 users =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(_us= ers _combination _ssh_users _ssh _ssh)

% scp hosts=
tags in context :completion::complete:scp::
=C2=A0 =C2=A0 argument-r= est options =C2=A0(_arguments _ssh)
tags in context :completion::complet= e:scp:argument-rest:
=C2=A0 =C2=A0 files hosts users =C2=A0(_ssh)
= =C2=A0 =C2=A0 globbed-files =C2=A0 =C2=A0 =C2=A0(_files _ssh)
=C2=A0 = =C2=A0 hosts =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(_hosts _combi= nation _ssh_hosts _ssh)
=C2=A0 =C2=A0 users =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0(_users _combination _ssh_users _ssh)
I am sorry, I can not understand what the output means.

The documentation says:

&q= uot;typically indicating a class of object that the user may need to distin= guish."

"Unlike the contexts (which tell= you how completion arrived at the point it did), the tags describe the thi= ngs it can complete here."

If you will be= kind enough to explain with the example you were talking about then it wou= ld be very helpful for me.

If you kindly make a co= mpletion function with more than one tag (Ex. frooble1, frooble2, frooble3)= and description of how they were useful. And how that function can be used= with `zstyle ':completion:*:aliens:*'....= ` then I will be very glad.

Thanks and Best Regards,

Ahmad Ismail


On Wed, Aug 26, 2020 at 4:57 PM Pe= ter Stephenson <p.w.steph= enson@ntlworld.com> wrote:
> On 26 August 2020 at 09:59 Ahmad Ismail <ismail783@gmail.com&g= t; wrote:
> The [documentation][1] says
>
> >=C2=A0 =C2=A0 =C2=A0zstyle ':completion:*:aliens:*' tag-or= der \
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0'frooble:-funny:funny\ frooble'= frooble
> >which is used when you're completing for the command aliens, w= hich
> presumably has completions tagged as `frooble' ...
>
> I understand that both context and tag can be viewed using <kbd>= ^Xh</kbd>.
> So, I tried the following command but suggestion did not show the tags= .
>
>=C2=A0 =C2=A0 =C2=A0% zstyle ':completion:*:aliens:*' tag-order= 'frooble:-funny:funny\
> frooble' frooble
>=C2=A0 =C2=A0 =C2=A0% aliens <kbd>TAB</kbd>
>=C2=A0 =C2=A0 =C2=A0Completing file
>=C2=A0 =C2=A0 =C2=A0Desktop/=C2=A0 =C2=A0 =C2=A0 =C2=A0Documents/=C2=A0= =C2=A0 =C2=A0dotfiles/=C2=A0 =C2=A0 =C2=A0 Downloads/
>=C2=A0 =C2=A0 =C2=A0% aliens <kbd>^Xh</kbd>
>=C2=A0 =C2=A0 =C2=A0tags in context :completion::complete:aliens::
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0globbed-files=C2=A0 (_files _default)=
>=C2=A0 =C2=A0 =C2=A0% aliens frooble <kbd>^Xh</kbd>
>=C2=A0 =C2=A0 =C2=A0tags in context :completion::complete:aliens::
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0globbed-files=C2=A0 (_files _default)=
>
> I think I am doing something wrong with
>
> > completions tagged as `frooble'
>
> Please help me understand how to use tags in zsh completion system.
Hi Ahmad,

That section in the guide is actually just an example of how things work using an invented command --- your understanding is basically correct but actually there is no "aliens" command.

Just off the top of my head (other people may have their own favourite
examples), one interesting command with a number of different tags
that apply at the start of completion is scp: ^xh for that gives me

tags in context :completion::complete:scp::
=C2=A0 =C2=A0 argument-rest options=C2=A0 (_arguments _ssh _ssh)
tags in context :completion::complete:scp:argument-rest:
=C2=A0 =C2=A0 files hosts users=C2=A0 (_ssh _ssh)
=C2=A0 =C2=A0 globbed-files=C2=A0 =C2=A0 =C2=A0 (_files _ssh _ssh)
=C2=A0 =C2=A0 hosts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (_hosts= _combination _ssh_hosts _ssh _ssh)
=C2=A0 =C2=A0 users=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (_users= _combination _ssh_users _ssh _ssh)

so that might be something to play with.

(Alternatively, if I got my act together I could probably write
a fake completion for "aliens" that actually did what the guide says...)

Cheers
pws
--0000000000004eb75805adc61e1c--