From: "Andrej Borsenkow" <borsenkow.msk@sni.de>
To: "Sven Wischnowsky" <wischnow@informatik.hu-berlin.de>,
<zsh-workers@sunsite.auc.dk>
Subject: RE: PATCH: new-style completion for parameters and options
Date: Wed, 24 Mar 1999 14:15:23 +0300 [thread overview]
Message-ID: <001c01be75e7$9c4fc040$21c9ca95@mowp.siemens.ru> (raw)
In-Reply-To: <199903231513.QAA19509@beta.informatik.hu-berlin.de>
>
> As Andrej mentioned, this had some problems.
>
> Making typeset print `local' for local parameters was simple. I've
> made it be printed after the type since there may uses relying on
> things like `array' to be the first on the line. Thank god I don't
> have to decide if this is important/careful enough to be included in
> an official version. If not, most the rest of this patch is pretty
> useless.
>
> This adds the files `Core/_{{set_,unset_}options,parameters}' to be
> able to easily complete them. The ones for the options also use a `-M'
> option for this ignore-underscore-and-map-upper-to-lower-case thing.
>
Again I must beg your pardon for (partial) noice yesterday :-(
1. Parameter completion.
This does not solve the problem generally enough. First of all, if user has
existing compctl, this will be called (with the same problem); second, you
cannot prevent users from calling compgen -vANIOpZN directly (I am not sure,
if all of them has this problem)
What is the reason for compgen (and compctl) to complete non-local variables
at all? compctl never did it before (it simply could not be called in such a
context) - so there is no compatibility change related to completion. (The
only case is user-defined ZLE widgets, and they did not exist in 3.0.x)
For really perversed, compgen -v || compgen -k "something with typeset"
could be used :-) And I think, that typeset addition is still useful.
2. options completion
I was taken away by the fact, that old compctl examples did it the same way
you do in this patch:
###compctl -s '$(setopt 2>/dev/null)' + -o + -x 's[no]' -o -- unsetopt
###compctl -s '$(unsetopt)' + -o + -x 's[no]' -o -- setopt
so, I was accustomed to the fact, that only unset/set options are completed.
As it stands now, compgen -o completes *any* option (irrespectively of
wether they are set or not) and does *not* have the above problem at all.
So, this patch is probably an overkill ...
But the idea with assoc array for options is still nice ...
cheers
/andrej
next prev parent reply other threads:[~1999-03-24 11:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-23 15:13 Sven Wischnowsky
1999-03-24 11:15 ` Andrej Borsenkow [this message]
1999-03-25 8:35 Sven Wischnowsky
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='001c01be75e7$9c4fc040$21c9ca95@mowp.siemens.ru' \
--to=borsenkow.msk@sni.de \
--cc=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).