ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Procházka Lukáš Ing. - Pontex s. r. o." <LPr@pontex.cz>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: System variable HOME
Date: Mon, 05 Nov 2012 09:15:52 +0100	[thread overview]
Message-ID: <op.wnajwqy6tpjj8f@lpr> (raw)
In-Reply-To: <CAF=dkzyCnGtNtrrQh7LfLqgTHDwBSMgQ91cvKWfEY5XZmC1S4A@mail.gmail.com>

Hello,

I can answer just the first point -

On Mon, 05 Nov 2012 00:15:17 +0100, Sietse Brouwer <sbbrouwer@gmail.com> wrote:

> Lukáš wrote:
>> it seems that Ctx [re]defines the system variable HOME on its run
>
> Did some digging, and indeed it does. This is what happens, if I read
> the code correctly (lines 11681-11696 of context/bin/mtxrun):
> * `homedir` is read from the environment variable USERPROFILE on
> Windows, and from HOME on Linux.
> * both USERPROFILE and HOME (and environment.homedir) are then set to
> the value of `homedir`.
>
> Questions this raises:
>
> (1) Windows does not seem to use HOME

That's true, that's why I decided to use a variable of this name.

> (it's not in any of the lists of
> environment variables that I found), only HOMEDRIVE and HOMEPATH, so
> what do you use it for?

That's true, too.

The HOMEPATH variable points to "c:/Document and Settings/blablabla" - I didn't want to change this variable to "my" value "d:/Lukas" as many programs may suppose location "c:/Document and Settings" and don't need to use "%HOMEPATH%" when they want to obtain the directory of user settings/data.

So, if possible (= when I CAN AFFECT some program behavior; like Ctx, gnuplot and other command-line oriented programs) I'm using "my" variable HOME.

Also, I redirected "My Documents" folder (under Windows) to "d:/Lukas".

Surprisingly, when you do this redirection (via "My Documents" properties - "Change Location" or similar button), "My Documents" location is changed but HOMEPATH variable keeps its default settings, "c:/Documents and Settings/...".

So the state of user documents folder is a bit "schizophrenic" from this moment as "My Documets" are redirected to "d:/Lukas" whilst HOMEPATH points to "c:/Documents and Settings/...".

As "My Documents" location is not detectable from the command line (supposing you don't use a tool which reads a key in the registry which contains the value of "My Documents" location), I defined (on all computers, notebooks etc. I'm working with) a new system [local] variable "HOME" which points to the same dir as "My Documents" and which was not in use by Windows.

There was no name HOME collision problem so far - so I choose this name.

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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-05  8:15 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áš
2012-11-04 23:15 ` Sietse Brouwer
2012-11-05  8:15   ` Procházka Lukáš Ing. - Pontex s. r. o. [this message]
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.wnajwqy6tpjj8f@lpr \
    --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).