From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25232 invoked from network); 19 Aug 2006 06:47:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Aug 2006 06:47:35 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 34009 invoked from network); 19 Aug 2006 06:47:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Aug 2006 06:47:29 -0000 Received: (qmail 28543 invoked by alias); 19 Aug 2006 06:47:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22626 Received: (qmail 28533 invoked from network); 19 Aug 2006 06:47:26 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Aug 2006 06:47:26 -0000 Received: (qmail 33705 invoked from network); 19 Aug 2006 06:47:26 -0000 Received: from luonnotar.infodrom.org (195.124.48.78) by a.mx.sunsite.dk with SMTP; 19 Aug 2006 06:47:25 -0000 Received: by luonnotar.infodrom.org (Postfix, from userid 10) id 74120366B89; Sat, 19 Aug 2006 08:47:25 +0200 (CEST) Received: by finlandia.home.infodrom.org (Postfix, from userid 2006) id 7F746FDA9; Sat, 19 Aug 2006 08:43:35 +0200 (CEST) Date: Sat, 19 Aug 2006 08:43:35 +0200 From: Matthias Kopfermann To: Bart Schaefer Cc: Zsh-Workers Subject: readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?) Message-ID: <20060819064335.GA13552@finlandia.home.infodrom.org> References: <20060818102602.GA24702@finlandia.home.infodrom.org> <20060818130849.GD15840@fsst.voodoo.lan> <060818110351.ZM24330@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <060818110351.ZM24330@torch.brasslantern.com> X-Operating-System: Debian GNU/Linux User-Agent: Mutt/1.5.12-2006-07-14 On Fri, Aug 18, 2006 at 11:03:51AM -0700, Bart Schaefer: > On Aug 18, 12:26pm, Matthias Kopfermann wrote: > } > } For _prompts_ i have to surround every variable with %{ %} which > } does not , aehem, look too nice. > > The colors function is meant to be entirely separable from prompts, so > it avoids reference to any prompt formatting strings. yes, i see that is not a good idea then. > Another reason I resisted this is that it leads to PS1 values that > contain lots more %{ %} pairs than are often necessary. E.g., for a > two-line prompt, you can often put the entire first line in a single > pair of %{ ... %}. if one only uses one color , you mean? perhaps i was mistaken to think that every escape code needs needs these %{ %} around it. so i thought it really had to be done with any new one. > } [snip] > } for i in ${(k)fg} ; do pfg[$i]="%{$fg[$i]%}" ; done > } [snap] > } > } to your .zshrc, but I guess a loadable function would be easier for > } new users. > > Perhaps a candidate for adding to the zsh-newuser-install function? That wouuld really be nice! The biggest problem in zsh functions is readability already. As much as i love zsh features and what pleasure they bring to console life i think that these already come with a very big cost: and that is very bad readability. Nearly every line in /usr/share/zsh/*/functions is so stuffed that it needs much concentration to understand what it's doing. So much, that i sometimes think of using m4 to use zsh features in shell programming and that is extremely alarming! [ And does not at all help in reading other code ] And prompt definitions belong in this category, too. Matthias