Having presented various options and problems, here's a
specific proposal. I'm open to counter-suggestions.
1. When gretl starts, we record the initial CWD and set shelldir
to this value.
2. When we come across a filename in a store or outfile (or
similar gretl) command we do the following:
(a) If it's an absolute path, respect it (of course).
(b) If it's a plain filename with no explicit path element,
we take it that @userdir is implied.
(c) If it's a "./" filename we use shelldir.
(d) Shelldir can be changed by the user via the set command,
and this will be respected in context (c).
In the context of actual "!" shell calls, you can of course do as
you like, giving absolute paths, using the @userdir variable,
setting shelldir, using "cd", or whatever. I don't propose trying
to push output into @userdir in that context.
I guess I can see a possible argument for using shelldir when
faced with a plain filename (case b), if shelldir has been
explicitly set by the user. But I'm not sure if that is more or
less confusing than always defaulting to @userdir.
Thus the notion is
store foo.gdt # gretl, write the file where you think is best
store ./foo.gdt # write the file HERE!
Allin.