Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?)
- X-seq: zsh-workers 22634
- From: Matthias Kopfermann <matthi@xxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- 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
- Cc: Zsh-Workers <zsh-workers@xxxxxxxxxx>
- In-reply-to: <060819113925.ZM28549@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060818102602.GA24702@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20060818130849.GD15840@xxxxxxxxxxxxxxx> <060818110351.ZM24330@xxxxxxxxxxxxxxxxxxxxxx> <20060819064335.GA13552@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <060819113925.ZM28549@xxxxxxxxxxxxxxxxxxxxxx>
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
- References:
- prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?
- From: Matthias Kopfermann
- Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?
- Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?
- readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?)
- From: Matthias Kopfermann
- Re: readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author