ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Procházka Lukáš" <LPr@pontex.cz>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: System variable HOME
Date: Sat, 03 Nov 2012 21:47:54 +0100	[thread overview]
Message-ID: <op.wm7td4xudk1lar@lk-2008-nbk> (raw)
In-Reply-To: <CAF=dkzyQWBHPd-UrNzgaM4NnLy9puwc8wKCvijOgGMmQ=Xb2GA@mail.gmail.com>

On Sat, 03 Nov 2012 12:43:26 +0100, Sietse Brouwer <sbbrouwer@gmail.com> wrote:

>> it seems that Ctx [re]defines the system variable HOME on its run;
>
> This is not an answer, but a guess: Could it be that your interactive
> shell uses one setting, and the non-interactive shell uses another?

I'm using the windows default shell - cmd.exe;
it is interactive in the manner that you can type a command on the command prompt and the command (or a program) is executed.

In Windows, when a process is created, it inherits current system variables.

If you launch a program from cmd.exe (= command line), the program (process) inherits all system variables existing in the moment of launching in the environment of the session of that cmd.exe.

(Various instances of cmd.exe don't inter-corporate in the point-of-view of system variables.)

Moreover, when the launched program changes a system variable, it changes it just in its-own scope;
so values of system variables of the calling cmd.exe are not affected.

BTW: I solved the problem a bit "hacky" (and hopefully temporarily, if we'll find a better solution): I'm calling "SET HOME.ORG=%HOME%" right before I launch context.exe;
so I can access my previous variable value.

Somewhere inside a Ctx source within a Lua scope I call:

----
local home = os.getenv("HOME.ORG") or os.getenv("HOME") or "MyUsualHomePath"
----

It works but it is not "nice" enough.

Best regards,

Lukas


> I'm only guessing here, I don't know much about Windows
> administration; I just remember being driven to despair by a similar
> 'these settings are not used if the shell is not interactive' problem
> under Linux.
>
> --Sietse


___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2012-11-03 20:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 16:28 Procházka Lukáš Ing. - Pontex s. r. o.
2012-11-03 11:43 ` Sietse Brouwer
2012-11-03 20:47   ` Procházka Lukáš [this message]
2012-11-04 23:15 ` Sietse Brouwer
2012-11-05  8:15   ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-11-05 17:46   ` Hans Hagen
2012-11-09 17:28     ` Sietse Brouwer
2012-11-19  8:16     ` Procházka Lukáš Ing. - Pontex s. r. o.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.wm7td4xudk1lar@lk-2008-nbk \
    --to=lpr@pontex.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).