From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: _arguments questions
Date: Wed, 5 Apr 2000 10:11:57 +0200 (MET DST) [thread overview]
Message-ID: <200004050811.KAA01592@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Alexandre Duret-Lutz's message of 04 Apr 2000 17:59:56 +0200
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2636 bytes --]
Alexandre Duret-Lutz wrote:
> >>> "Sven" == Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:
>
> Sven> Alexandre Duret-Lutz wrote:
>
> [...]
>
> >> 1) is there a simplier way to nest `_arguments' ?
>
> Sven> I don't see any. Sorry. Adding more syntactic sugar to the
> Sven> _argument specs to support this doesn't seem worth it unless we put
> Sven> it into the <action>. Then it's quite simple (making _arguments
> Sven> insert the dummy, probably using the option name for it).
>
> Isn't the `*pattern::message' spec quite the same ?
> The `*' or
> the pattern may also be separated from the
> message by two or three colons. With two
> colons the words special array and the CUR
> RENT special parameter are modified to refer
> only to the words after the option (with two
> colons)
>
> What we want here is that `words' and `CURRENT' refer to the
> words after the option, *including the option*.
> Why not a four colons separator ?
>
> _arguments -a -b '-c:*::::blah: _arguments -c -d -e'
>
> Horrible !
Because of that (;-) and because it isn't quite the same (but I
confess, I had the same idea...). Especially, adding this dummy
element might be useful to combine with both `::' and `:::'.
> Sven> Should we?
>
> I would find this helpfull, since it prevent from writting intermediate
> functions (and since _argument is *the* easy way to write completion
> functions, it should better nest without requiring the user to dig the
> completion system).
Hm, yes. I guess many people won't use $words and friends directly...
> Another idea: Isn't there a way to make _arguments detect whether it has
> been nested or not ? (I don't know, maybe when the <argument> part
> of the context is already set ?). Of course this solve only the
> _arguments nesting problem, not the more general "words and CURRENT
> include the current option" behaviour.
This could be easily done by looking at $funcstack. But it would be
wrong to do that, I think, because there may be cases where one
doesn't want this dummy element and if the nested call to _arguments
inserts it automatically one has no way to circumvent it. Unless we
add a option to _aguments, but that would be more obscure than adding
it to the action of the outer _arguments. Also, only in the outer
_arguments can it be decided if we need a dummy element.
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-04-05 8:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-05 8:11 Sven Wischnowsky [this message]
2000-04-05 9:28 ` Alexandre Duret-Lutz
-- strict thread matches above, loose matches on Subject: below --
2000-04-05 12:03 Sven Wischnowsky
2000-04-05 13:01 ` Alexandre Duret-Lutz
2000-04-05 9:43 Sven Wischnowsky
2000-04-04 12:54 Sven Wischnowsky
2000-04-04 15:59 ` Alexandre Duret-Lutz
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=200004050811.KAA01592@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/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).