zsh-workers
 help / color / mirror / code / Atom feed
From: Matthias Kopfermann <matthi@infodrom.north.de>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh-Workers <zsh-workers@sunsite.dk>
Subject: Re: readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?)
Date: Sun, 20 Aug 2006 08:56:51 +0200	[thread overview]
Message-ID: <20060820065651.GA27688@finlandia.home.infodrom.org> (raw)
In-Reply-To: <060819113925.ZM28549@torch.brasslantern.com>

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


  reply	other threads:[~2006-08-20  6:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-18 10:26 prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function? Matthias Kopfermann
2006-08-18 13:08 ` Frank Terbeck
2006-08-18 18:03   ` Bart Schaefer
2006-08-19  6:43     ` readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?) Matthias Kopfermann
2006-08-19 18:39       ` Bart Schaefer
2006-08-20  6:56         ` Matthias Kopfermann [this message]
2006-08-20 17:33           ` Bart Schaefer
2006-08-20 18:47             ` Matthias Kopfermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060820065651.GA27688@finlandia.home.infodrom.org \
    --to=matthi@infodrom.north.de \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).