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: readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?)
Date: Sat, 19 Aug 2006 08:43:35 +0200	[thread overview]
Message-ID: <20060819064335.GA13552@finlandia.home.infodrom.org> (raw)
In-Reply-To: <060818110351.ZM24330@torch.brasslantern.com>

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


  reply	other threads:[~2006-08-19  6:47 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     ` Matthias Kopfermann [this message]
2006-08-19 18:39       ` readability (was: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?) Bart Schaefer
2006-08-20  6:56         ` Matthias Kopfermann
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=20060819064335.GA13552@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).