zsh-workers
 help / color / mirror / code / Atom feed
* Number of psvar entries
@ 2013-03-13  9:03 Mikael Magnusson
  2013-03-13  9:31 ` Nikolai Weibull
  2013-03-13  9:38 ` Peter Stephenson
  0 siblings, 2 replies; 4+ messages in thread
From: Mikael Magnusson @ 2013-03-13  9:03 UTC (permalink / raw)
  To: zsh workers

The manpage tells us

psvar <S> <Z> (PSVAR <S>)
 An array (colon-separated list) whose first nine values can be used
in PROMPT strings.  Setting psvar also sets PSVAR, and vice versa.

but

% psvar[25]=hello; print -P %25v
hello

Am I missing something?

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Number of psvar entries
  2013-03-13  9:03 Number of psvar entries Mikael Magnusson
@ 2013-03-13  9:31 ` Nikolai Weibull
  2013-03-13  9:38 ` Peter Stephenson
  1 sibling, 0 replies; 4+ messages in thread
From: Nikolai Weibull @ 2013-03-13  9:31 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh workers

On Wed, Mar 13, 2013 at 10:03 AM, Mikael Magnusson <mikachu@gmail.com> wrote:
> The manpage tells us
>
> psvar <S> <Z> (PSVAR <S>)
>  An array (colon-separated list) whose first nine values can be used
> in PROMPT strings.  Setting psvar also sets PSVAR, and vice versa.
>
> but
>
> % psvar[25]=hello; print -P %25v
> hello
>
> Am I missing something?

>From reading the code in Src/prompt.c, it seems that the documentation is stale.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Number of psvar entries
  2013-03-13  9:03 Number of psvar entries Mikael Magnusson
  2013-03-13  9:31 ` Nikolai Weibull
@ 2013-03-13  9:38 ` Peter Stephenson
  2013-03-13 16:59   ` Bart Schaefer
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2013-03-13  9:38 UTC (permalink / raw)
  To: zsh workers

On Wed, 13 Mar 2013 10:03:20 +0100
Mikael Magnusson <mikachu@gmail.com> wrote:
> The manpage tells us
> 
> psvar <S> <Z> (PSVAR <S>)
>  An array (colon-separated list) whose first nine values can be used
> in PROMPT strings.  Setting psvar also sets PSVAR, and vice versa.
> 
> but
> 
> % psvar[25]=hello; print -P %25v
> hello
> 
> Am I missing something?

Evidently the manual page is...  That restriction certainly goes way
back to very early versions of zsh.  It's possible numeric argument
handling in prompts was original limited and we upgraded it to handle
any integer that fits in integer precision; I don't actually remember
that happening, but I do remember the prompt code evolving quite a lot.
If it happened, I've a suspicion it would have been way back before the
CVS archive.

In which case the manual page simply needs updating.

pws


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Number of psvar entries
  2013-03-13  9:38 ` Peter Stephenson
@ 2013-03-13 16:59   ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2013-03-13 16:59 UTC (permalink / raw)
  To: zsh workers

On Mar 13,  9:38am, Peter Stephenson wrote:
}
} > % psvar[25]=hello; print -P %25v
} > hello
} > 
} > Am I missing something?
} 
} Evidently the manual page is...  That restriction certainly goes way
} back to very early versions of zsh.

I happen to have sitting around a binary of zsh 2.4.306 beta, and at
that version the documentation is correct (and really strange stuff
can happen if psvar[1,9] are all empty).  By 3.0.5 indices above 9
are usable.  So there's a chance the change is in CVS somewhere if
that's interesting for some reason.

} In which case the manual page simply needs updating.

I'd say so.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-13 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-13  9:03 Number of psvar entries Mikael Magnusson
2013-03-13  9:31 ` Nikolai Weibull
2013-03-13  9:38 ` Peter Stephenson
2013-03-13 16:59   ` Bart Schaefer

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).