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

Re: PATCH: new parameter flag?



Sven Wischnowsky wrote:
>This adds the `%' flag to parameter expansion. It makes the result of
>the expansion undergo prompt expansion.

Yes!  I've wanted this for the built-in strftime, in all the daemons I've
ever written in zsh.  (print -P has some other undesirable semantics.)

>+item(tt(%))(
>+Expand all tt(%) escapes in the resulting words in the same way as in
>+prompts (see noderef(Prompt Expansion)).
>+)

Actually I think it'll do full prompt expansion, affected by the options
PROMPT_EXPAND, PROMPT_BANG and PROMPT_PERCENT.  It would be nice to
have another flag to do just % sequences, i.e., do prompt expansion with
options NO_PROMPT_EXPAND, NO_PROMPT_BANG and PROMPT_PERCENT temporarily
set.  Say, (%) for just % sequences, and (%%) for full prompt expansion.

-zefram



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