From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11119 invoked from network); 24 Mar 1999 11:37:09 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Mar 1999 11:37:09 -0000 Received: (qmail 15064 invoked by alias); 24 Mar 1999 11:16:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5920 Received: (qmail 15057 invoked from network); 24 Mar 1999 11:16:09 -0000 From: "Andrej Borsenkow" To: "Sven Wischnowsky" , Subject: RE: PATCH: new-style completion for parameters and options Date: Wed, 24 Mar 1999 14:15:23 +0300 Message-ID: <001c01be75e7$9c4fc040$21c9ca95@mowp.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 In-Reply-To: <199903231513.QAA19509@beta.informatik.hu-berlin.de> Importance: Normal > > 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