Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "typeset -p" inconsistency



On Tue, Nov 1, 2022 at 3:46 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> On 2022-11-01 14:40, Bart Schaefer wrote:
> > It doesn't actually re-create anything right then, but the definition
> > of -p is "display in the format of a typeset command"
> Still I just wish there was some simple way of displaying the state of
> things without the pseudo re-creation.  It seems like a simple thing.

paste =(typeset +) =(set)

or perhaps (following is one line, gmail may wrap it)

print -lr -- ${(*)${(Aok)parameters}//(#m)*/${(Pt)MATCH} "$(typeset -m
${(q)MATCH})"}

(Use "setopt extendedglob" instead of (*) for zsh before 5.9)

> >> fignore=(  )
> >> FPATH=...
>
> No, I mean it seems a bit long and a bit belabored.  I'm just saying
> that I'd expect those variables to be set to standard internal paths

The internal value for FPATH is determined by the build-time options
to match the install locations of the functions.  There are typically
two options:  Place all the function files in a single directory
(which results in a short FPATH but possible name collisions) or
preserve the source tree directory hierarchy (which results in what
you saw).  The latter is often used because then it's possible to
(after the fact) omit directories that are not relevant.

> Come to think of it, those directories are in the 'fignore' ...
> are they to be ignored?

Please disconnect fignore from FPATH in your brain.  They are totally
unrelated things.  You may be thinking of fpath, which is the
tied-array equivalent of the FPATH tied-scalar.




Messages sorted by: Reverse Date, Date, Thread, Author