help / color / mirror / code / Atom feed
From: "Jörg Sommer" <joerg@jo-so.de>
To: Oliver Kiddle <opk@zsh.org>
Cc: zsh-users@zsh.org
Subject: Re: How to get all tagets for rake completion?
Date: Wed, 31 Mar 2021 09:45:48 +0200	[thread overview]
Message-ID: <20210331074548.b47tt6d2ekjrwdrs@jo-so.de> (raw)
In-Reply-To: <43486-1617149414.412147@zBmo.ESTa.9XAh>

[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]

Oliver Kiddle schrieb am Mi 31. Mär, 02:10 (+0200):
> On 15 Dec, Jörg Sommer wrote:
> > > > I would like to get all targets for the completion of rake arguments. How
> > > > can I inject an argument to the targets query call or how to replace it? I
> > > > have to pass `-A` to *rake* to get the arguments for the completion.
> Sorry that this patch didn't receive any attention earlier.

No problem. Don't worry.

> To try to understand this, what is the disadvantage of calling rake with
> -A? Does that make it much slower or is it that most users wouldn't want
> "uncommented" targets?

It gives a much huger list and might contain many entries someone will never
use. But I don't know what's common. From my point of view I prefer more
than less.

> Incidentally, _rake doesn't seem to complete the -A option so that must
> be newish.

I found this commit:
from Oct 16, 2012 included in tag rake-0.9.3. I think it's old enough the be
seen as commonly available.

> > What do you think about the attached commit? Is it fine or should I change
> > anything?
> When looking up the style, you should include the tag in the context
> when one is applicable, so ":completion:${curcontext}:targets" in this
> case.

Ah, okay. I must admit, I've never used zsytle queries before. I would make
this change, right?

-    zstyle -t ":completion:${curcontext}" all-targets && all=-A
+    zstyle -t ":completion:${curcontext}:targets" all-targets && all=-A

> As a general principle, it is better to use a style name that has a
> generic meaning. I can't find any existing style along the lines of an
> extra-matches, more-matches, allow-slow-generation etc so unless I've
> missed one you'd need to invent a suitable one. "all-targets" is too
> specific to targets.

How about ‘verbose’?

Wer geliebt, kann nicht vergessen,
Wer vergisst, hat nie geliebt,
Wer geliebt und doch vergessen,
Hat vergessen, wie man liebt!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 269 bytes --]

  reply	other threads:[~2021-03-31  7:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 12:57 Jörg Sommer
2020-12-15 17:12 ` Peter Stephenson
2020-12-15 21:40   ` Jörg Sommer
2021-03-31  0:10     ` Oliver Kiddle
2021-03-31  7:45       ` Jörg Sommer [this message]
2021-03-31  9:50         ` Oliver Kiddle
2021-04-04  8:28           ` Jörg Sommer
2021-04-08 21:51             ` Oliver Kiddle
2021-04-12  8:07               ` Jörg Sommer
2021-04-25 16:34                 ` Lawrence Velázquez
2021-05-02 16:52                   ` Lawrence Velázquez
2021-05-09 17:32                     ` Lawrence Velázquez
2021-05-10 12:14                       ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210331074548.b47tt6d2ekjrwdrs@jo-so.de \
    --to=joerg@jo-so.de \
    --cc=opk@zsh.org \
    --cc=zsh-users@zsh.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).