On 5/6/2020 5:43 PM, cont...@vivaldi.net wrote:
Hello,
before I run ConTeXt, I set a (new) variable "HOME" to point to a
particular directory.
ConTeXt changes its value during startup - it sets its value to
%USERPROFILE% - I guess it is to unify environment somehow for all
platforms ConTeXt supports; probably here:
---- data-ini.lua, ln. ~86
do
local homedir = osgetenv(ostype == "windows" and 'USERPROFILE' or
'HOME') or ''
if not homedir or homedir == "" then
homedir = char(127) -- we need a value, later we wil trigger on it
end
homedir = file.collapsepath(homedir)
ossetenv("HOME", homedir) -- can be used in unix cnf files
<<<<<<<<<<<<<< HERE
ossetenv("USERPROFILE",homedir) -- can be used in windows cnf files
environment.homedir = homedir
end
----
But anyway - would it be possible to store the original value of HOME
environment variable (if set) before it gets changed during
initialization - e.g. to a Lua table?
- I would need to work with the original value in run-time (Win7 / WinX;
ConTeXt MkIV).
I'll add
environment.oldhome
being the original one (but no testing done here)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________