zsh-users
 help / color / mirror / code / Atom feed
From: "Ronan Pigott" <rpigott314@gmail.com>
To: <zsh-users@zsh.org>
Subject: Re: Possible to use _arguments with _regex_arguments?
Date: Wed, 18 Sep 2019 13:21:38 -0700	[thread overview]
Message-ID: <BX3EOWYQ1AY8.LBR42DF8EFH7@rxps> (raw)
In-Reply-To: <BX2RX80O9EQW.26O4G1RH2WSIK@rxps>

On Tue Sep 17, 2019 at 7:31 PM Ronan Pigott wrote:
> One thing I thought to try was set '{words=("$line[@]"); _myfunc}' for
> the action, but it did not seem to work.
> 
> If it cannot be done, is there another way that I can transform the line
> to be completed before running (or re-running) the completion to make
> this idea possible?

I've since found that _arguments itself has the ability to transform the
words and CURRENT special parameters by specifying the argument like:
'*::message:action', but unfortunately it still does not produce the
desired result when 'action' is a function generated by
_regex_arguments. Can anyone explain the behavior I see?

What I observe is that when _myfunc is created by _regex_arguments, and
the command argument is passed to _arguments like so: '*:message:_myfunc'

	`command arg1 arg2` is completed correctly as expected by _myfunc
	`command -o option arg1` is offered no completions by _myfunc, as it
	does not match.

When I use '*::message:_myfunc', completion is no longer tripped up by
options, but _myfunc always acts as if it is completing the first word
for all normal arguments, as if $words was empty and CURRENT=1 even if
there are many normal arguments. I'm looking for a way to have _myfunc
when invoked as an action of _arguments see only (and all of) the normal
arguments, but for some reason the _regex_arguments functions don't seem
to behave that way.

  reply	other threads:[~2019-09-18 20:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  2:31 Ronan Pigott
2019-09-18 20:21 ` Ronan Pigott [this message]
2019-09-18 21:07   ` Bart Schaefer
2019-09-18 21:36     ` Ronan Pigott
2019-09-18 21:32   ` Oliver Kiddle

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=BX3EOWYQ1AY8.LBR42DF8EFH7@rxps \
    --to=rpigott314@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.vuxu.org/mirror/zsh/

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).