Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: expl not always local
- X-seq: zsh-workers 21305
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: expl not always local
- Date: Thu, 02 Jun 2005 17:02:47 +0000
- In-reply-to: <2817.1117730651@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20050602132519.GA10266@xxxxxxxxxxxxxxxxxxxxx> <1050602152831.ZM12324@xxxxxxxxxxxxxxxxxxxxxxx> <2817.1117730651@xxxxxxxxxxxxxxxxxxxxxxx>
On Jun 2, 6:44pm, Oliver Kiddle wrote:
} Subject: Re: PATCH: expl not always local
}
} Bart wrote:
} > Careful with these. They may be expecting to be called in a context
} > where the caller has declared expl as a local.
} >
} > In general, if a function file starts with #autload then it's a
} > utility and should NOT declare completion system variables as locals,
}
} I disagree. The only way we should be passing stuff to #autoload (Type/)
} functions is with the positional parameters.
I agree with your "should" but I don't believe that it's presently the
case that all completion functions work that way. Blindly adding a lot
of "local" declarations without investigating the calling contexts is
a road to mysterious future breakage.
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).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author