Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: expl not always local
- X-seq: zsh-workers 21314
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: expl not always local
- Date: Mon, 06 Jun 2005 19:26:54 +0200
- In-reply-to: <1050602170247.ZM12815@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20050602132519.GA10266@xxxxxxxxxxxxxxxxxxxxx> <1050602152831.ZM12324@xxxxxxxxxxxxxxxxxxxxxxx> <2817.1117730651@xxxxxxxxxxxxxxxxxxxxxxx> <1050602170247.ZM12815@xxxxxxxxxxxxxxxxxxxxxxx>
On 2 Jun, Bart wrote:
>
> In part this is because the inner workings of the completion system are
> so sketchily documented. The Doc/compsys.yo entry for _wanted, for example,
> doesn't use "local expl" in its examples, and none of the documentation is
> clear that the name "expl" is merely a convention for the second argument
> of things like _request/_wanted/_next_label/etc. (i.e., any other name
> ought to do just as well, but probably won't).
In one form of _arguments' specifications, expl is literally used and is
not a convention. I think the same applies for _regex_arguments.
However, quoting from the _description documentation:
The resulting options for compadd are put into the array named
/name/ (this is traditionally `expl', but this convention is
not enforced).
Documentation for the various other functions such as _wanted are mostly
fairly clear that _description is called for the descriptions.
As you point out, the documentation does omit to declare expl local in
the _wanted example. It might have been better if _wanted declared expl
local itself and didn't require it as a parameter. However the patch
below fixes the documentation.
Relying on other Type/ functions to return stuff in expl seems like a
weird thing to do. Can you really find any example? Reviewing the
calling contexts would be useful but as one step to cleaning up the
functions, I'd happily see Doug's change included.
Oliver
Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.181
diff -u -r1.181 compsys.yo
--- Doc/Zsh/compsys.yo 28 May 2005 04:26:58 -0000 1.181
+++ Doc/Zsh/compsys.yo 6 Jun 2005 17:20:51 -0000
@@ -4370,7 +4370,8 @@
Hence to offer only one tag and immediately add the corresponding
matches with the given description:
-example(_wanted tag expl 'description' \
+example(local expl
+_wanted tag expl 'description' \
compadd matches...)
Note that, as for tt(_requested), the var(command) must be able to
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author