From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27105 invoked from network); 20 Aug 2006 06:57:28 -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; 20 Aug 2006 06:57:28 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 46614 invoked from network); 20 Aug 2006 06:57:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Aug 2006 06:57:22 -0000 Received: (qmail 8901 invoked by alias); 20 Aug 2006 06:57:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22634 Received: (qmail 8889 invoked from network); 20 Aug 2006 06:57:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 20 Aug 2006 06:57:19 -0000 Received: (qmail 46388 invoked from network); 20 Aug 2006 06:57:19 -0000 Received: from luonnotar.infodrom.org (195.124.48.78) by a.mx.sunsite.dk with SMTP; 20 Aug 2006 06:57:19 -0000 Received: by luonnotar.infodrom.org (Postfix, from userid 10) id 9F230366B90; Sun, 20 Aug 2006 08:57:18 +0200 (CEST) Received: by finlandia.home.infodrom.org (Postfix, from userid 2006) id 922FAFDAA; Sun, 20 Aug 2006 08:56:51 +0200 (CEST) Date: Sun, 20 Aug 2006 08:56:51 +0200 From: Matthias Kopfermann To: Bart Schaefer Cc: Zsh-Workers Subject: Re: readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?) Message-ID: <20060820065651.GA27688@finlandia.home.infodrom.org> References: <20060818102602.GA24702@finlandia.home.infodrom.org> <20060818130849.GD15840@fsst.voodoo.lan> <060818110351.ZM24330@torch.brasslantern.com> <20060819064335.GA13552@finlandia.home.infodrom.org> <060819113925.ZM28549@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <060819113925.ZM28549@torch.brasslantern.com> X-Operating-System: Debian GNU/Linux User-Agent: Mutt/1.5.13 (2006-08-11) On Sat, Aug 19, 2006 at 11:39:25AM -0700, Bart Schaefer: > } 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. > > Think of it in terms of cursor motion. You need %{ when the cursor > stops moving and %} when it starts again, and in between you can do > anything you like (including sending the cursor off to some other > part of the screen, as long as you bring it back to the original spot > again before closing the braces). You also need %{ and %} only as > they affect the same screen line where the prompt finally finishes, > because zle only cares about horizontal position, not vertical. This was very helpful to me as I did not consider color to be a cursor motion but i know that ansi escapes include those. I do remember seeing the effect of bad cursor movement in bash 1 when programming my PS1-prompt :) and when i ever forget to use %{ %} at zsh PS1 once more. :) > } The biggest problem in zsh functions is readability > > You mean in cryptic sytax for parameter expansions and format strings. The lack of white space is something i really suffer in specific zsh features often and the abundance of tooooooooooo long lines. That makes reading so exhausting and I know it's not only me! Functions to having done many of these nice builtin features like splitting, joining, uppercasing e.g. would have had a much better effect on readability. Instead it's done using modifiers. Variables nestings have to be blamed for much of the rest. What would I lose if I was not to go the dirty nesting way but assign to the same variable once again? When would I really suffer from efficiency lack? Ever? My only other help are continuation lines. Matthias