From: Borzenkov Andrey <Andrey.Borzenkov@siemens.com>
To: "'Haakon Riiser'" <haakon.riiser@fys.uio.no>, zsh-users@sunsite.dk
Subject: RE: Scope of local parameters
Date: Mon, 5 May 2003 10:47:38 +0400 [thread overview]
Message-ID: <6134254DE87BD411908B00A0C99B044F05A0C913@mowd019a.mow.siemens.ru> (raw)
In-Reply-To: <20030501172022.GA4179@s.chello.no>
>
> Are there ways to limit the scope of local parameters besides
> functions? Say you want to colorize the prompt, and you use
> helper variables for the color escape sequences:
>
> local RED=...
> local GREEN=...
> local BLUE=...
>
> PS1=<use RGB variables here>
>
> If I do this in ~/.zshrc, or a file sourced by .zshrc, the
> variables declared local do not disappear after sourcing ~/.zshrc.
>
> One way to work around this is to wrap the PS1 initialization in
> an auxiliary function, but then you have the same problem with
> the scope of the function. :-) Alternatively, one could
>
> unset RED GREEN BLUE
>
> after setting PS1, but this doesn't feel quite right. What if
> the parameters RED GREEN BLUE already existed? There has to be
> a better way.
>
Would you please next time specify Zsh version?
local foo=XXX
"~/.zshrc" 127L, 1859C written
bor@itsrm2% zsh
bor@itsrm2% echo $foo
bor@itsrm2% echo $ZSH_VERSION
4.1.1-test-1
-andrey
next prev parent reply other threads:[~2003-05-05 6:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-01 17:20 Haakon Riiser
2003-05-05 6:47 ` Borzenkov Andrey [this message]
2003-05-05 6:57 ` 'Haakon Riiser'
2003-05-05 7:37 ` Borzenkov Andrey
2003-05-05 8:06 ` Borzenkov Andrey
2003-05-06 10:04 ` Peter Stephenson
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=6134254DE87BD411908B00A0C99B044F05A0C913@mowd019a.mow.siemens.ru \
--to=andrey.borzenkov@siemens.com \
--cc=haakon.riiser@fys.uio.no \
--cc=zsh-users@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).