From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25659 invoked from network); 31 Aug 1999 12:47:36 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Aug 1999 12:47:36 -0000 Received: (qmail 242 invoked by alias); 31 Aug 1999 12:47:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7577 Received: (qmail 234 invoked from network); 31 Aug 1999 12:47:27 -0000 Date: Tue, 31 Aug 1999 14:43:30 +0200 (MET DST) Message-Id: <199908311243.OAA29911@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Zefram's message of Tue, 31 Aug 1999 13:25:56 +0100 (BST) Subject: Re: PATCH: new parameter flag? Zefram wrote: > Sven Wischnowsky wrote: > >+ opts[PROMPTPERCENT] = 1; > >+ if (presc < 2) > >+ opts[PROMPTSUBST] = opts[PROMPTBANG] = 0; > > No, that's nasty. I can see a need for % expansion, and I can see > a need for prompt expansion, but prompt expansion with % sequences > unconditionally enabled? If the user wants something so obscure, they > can twiddle the options themselves. Make the above > > if (presc < 2) { > opts[PROMPTPERCENT] = 1; > opts[PROMPTSUBST] = opts[PROMPTBANG] = 0; > } Hm, yes, I was lead to this mainly by the `name' of the flag. Bye Sven --- os/subst.c Tue Aug 31 14:40:29 1999 +++ Src/subst.c Tue Aug 31 14:40:34 1999 @@ -1662,9 +1662,10 @@ int ops = opts[PROMPTSUBST], opb = opts[PROMPTBANG]; int opp = opts[PROMPTPERCENT], len; - opts[PROMPTPERCENT] = 1; - if (presc < 2) + if (presc < 2) { + opts[PROMPTPERCENT] = 1; opts[PROMPTSUBST] = opts[PROMPTBANG] = 0; + } if (isarr) { char **ap; diff -u od/Zsh/expn.yo Doc/Zsh/expn.yo --- od/Zsh/expn.yo Tue Aug 31 14:41:26 1999 +++ Doc/Zsh/expn.yo Tue Aug 31 14:42:15 1999 @@ -606,8 +606,8 @@ Expand all tt(%) escapes in the resulting words in the same way as in prompts (see noderef(Prompt Expansion)). If this flag is given twice, full prompt expansion is done on the resulting words, depending on the -setting of the tt(PROMPT_SUBST) and tt(PROMPT_BANG) options. The -tt(PROMPT_PERCENT) option is temporarily turned on in any case. +setting of the tt(PROMPT_PERCENT), tt(PROMPT_SUBST) and +tt(PROMPT_BANG) options. ) item(tt(X))( With this flag parsing errors occuring with the tt(Q) flag or the -- Sven Wischnowsky wischnow@informatik.hu-berlin.de