From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29286 invoked from network); 3 May 1999 08:36:34 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 May 1999 08:36:34 -0000 Received: (qmail 12821 invoked by alias); 3 May 1999 08:36:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6193 Received: (qmail 12813 invoked from network); 3 May 1999 08:36:10 -0000 Message-Id: <9905030811.AA41496@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: User installation script for new completion In-Reply-To: ""Bart Schaefer""'s message of "Sun, 02 May 1999 17:34:44 DFT." <990502173444.ZM11144@candle.brasslantern.com> Date: Mon, 03 May 1999 10:11:29 +0200 From: Peter Stephenson "Bart Schaefer" wrote: > } typeset -A options > } options=($(setopt kshoptionprint;setopt)) > } [[ -o kshoptionprint ]] || options[kshoptionprint]=off > } [[ -o monitor ]] && options[monitor]=on > } [[ -o zle ]] && options[zle]=on > > unsetopt ${(k)options[(R)off]} no${(k)^options[(R)on]} Unfortunately that doesn't work because of the way options on by default are printed with `no' in front anyway, in which case sticking another no in front messes it up. (Maybe your setopt is a function to get round it.) However, unsetopt ${(k)options[(R)off]} setopt ${(k)options[(R)on]} ought to do the trick. But it doesn't; you get things like unsetopt: can't change option: singlecommand which is misleading anyway. Why don't we change it so that it doesn't complain if you're setting an option to its existing value? --- Src/options.c.so Thu Mar 25 10:38:43 1999 +++ Src/options.c Mon May 3 10:07:14 1999 @@ -635,6 +635,8 @@ } } else if(!force && (optno == INTERACTIVE || optno == SHINSTDIN || optno == SINGLECOMMAND)) { + if (opts[optno] == value) + return 0; /* it is not permitted to change the value of these options */ return -1; } else if(!force && optno == USEZLE && value) { -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy