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

Re: Unmetafy of getsparam()

On Sun, 19 Jul 2015 01:13:54 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Here's a patch that attempts to clean up [un]metafication of non-special
> parameter values used internally to the shell.  Well, some of them.

Seems to make sense.  You can commit it now.  (Oops...)

> I'm unsure what to do with:
> - ENV in init.c -- for parsestr() is a tokenized string also metafied?

The intention must surely be yes: parsestr() operates on internal
strings way after the input stage, and indeed metafication occurs early
in that, as witness zleread() returns a metafied line back to input.c
(and so does shingetline() if ZLE is not in use), so it's already
metafied by the time it hits the input stack --- so the string to be
parsed needs to be metafied as it's put back on the input stack.

Whether all pathways are correct is another question.

> - untok_and_escape() in subst.c

I think this has internal (metafied) strings at both input and output.

> - spckword() in utils.c -- patcompile expects a metafied string?

Yes, it does: I think spckword() gets a metafied string: zle_tricky.c
isn't easily penestrable but that's because it's dealing with shell
internal string, which should be metafied.

> - all of hist.c is a mess with respect to handling of HISTFILE

Yes, Mikael and I had extreme fun with this together with heckles from
the crowd for added effect about our efforts to keep it consistent.
(No doping allegations, at least...)  Probably best left alone until
something else turns up.

> - getcvar() in math.c

That's supposed to be handling it already within the function.

> - savesession() in zftp.c

This is all internal state, isn't it?  So as long as it's consistent it
doesn't matter.

> - LISTPROMPT in complistmatches()

That turns ultimately into the fmt used in compprintfmt, I think.
This already seems to be prepared to handle metafied strings,
though again whether it does so consistently may well not have been


Look to me like they all go to places that have some sort of a metafied
feel about them.  I'm guessing something customisable like this is
likely to have had a fair amount of kanji or katakana thrown at it by


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