Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 4/4] _normal: Add -P to reset precommands



On 1 Apr 2019, at 22:13, Matthew Martin <phy1729@xxxxxxxxx> wrote:
>Add the ability to reset the precommands array to empty. Will be useful
>for zsh -c and perhaps some other situations. Again the texi is
>cargo-culted.

I like it. The documentation looks mostly OK to me, but:

>+xitem(tt(_normal) [ tt(-P) | tt(-p) var(precommand) ])(

I know it wasn't your fault, but i think this should be item()(), not
xitem()(). I don't fully understand the distinction, but xitem() seems to be
used only when there are multiple headings (describing different ways to use
the command); left here, it breaks the man-page formatting for the paragraphs
you added.

> completes after pre-command specifiers such as tt(nohup), removes the

Also not your fault, but this is the only place in the documentation
(including your changes) where 'pre-command' is hyphenated. Maybe fix that?

>+Append var(precommand) to the list of precommands. Should be used in
>+Reset the list of precommands. Should be used if completing a command

This clipped style (ommitting the subject of the sentence) isn't used anywhere
else in the documentation that i can see.

>+  '*::arguments: _normal -p $service'

The 'arguments' here is superfluous.

idk if you planned to do another pass, but i noticed several straight-forward
examples of other functions that could make use of `_normal -p`: _env,
_fakeroot, _nice, _stdbuf, _timeout, &c. _env is kind of a special case,
though, in that it (ab)uses _normal's standard behaviour to provide
variable-assignment completion too. Maybe there's a general solution for that

dana



Messages sorted by: Reverse Date, Date, Thread, Author