diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-06-14 19:08:06 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-06-14 19:08:06 +0200 |
commit | 15409bae5ffdfce4ef17c4ccf14c8cd4c1b8f37e (patch) | |
tree | 852b915a69d57679a05ef5fec0ee6608cdcf2dee /doc/sciteco.1.in | |
parent | 573951d4e2bb4fb1d14212583a59ce76344593cc (diff) | |
download | sciteco-15409bae5ffdfce4ef17c4ccf14c8cd4c1b8f37e.tar.gz |
handle environment variables more consistently
* the registers beginning with "$" are exported into sub-process
environments. Therefore macros can now modify the environment
(variables) of commands executed via EC/EG.
A variable can be modified temporarily, e.g.:
[[$FOO] ^U[$FOO]bar$ EC...$ ][$FOO]
* SciTECO accesses the global environment registers instead of
using g_getenv(). Therefore now, tilde-expansion will always
use the current value of the "$HOME" register.
Previously, both register and environment variable could diverge.
* This effectively fully maps the process environment to a subset of
Q-Registers beginning with "$".
* This hasn't been implemented by mapping those registers to
special implementations that updates the process environment
directly, since g_setenv() is non-thread-safe on UNIX
and we're expected to have threads soon - at least in the GTK+ UI.
Diffstat (limited to 'doc/sciteco.1.in')
-rw-r--r-- | doc/sciteco.1.in | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/doc/sciteco.1.in b/doc/sciteco.1.in index 0f091db..ef49579 100644 --- a/doc/sciteco.1.in +++ b/doc/sciteco.1.in @@ -149,15 +149,27 @@ environment are inserted into the global Q-Register table. A dollar sign is prepended before each variable name, so that for instance the variable \(lqHOME\(rq can be examined by macros by reading the string-content of Q-Register \(lq$HOME\(rq. -Changes to these Q-Registers are currently not applied to -the corresponding environment variables. .LP -The following environment variables are initialized with default -values by \*(ST if they are unset: +Changes to these environment registers are not applied to +the process environment for technical reasons. +Nevertheless, \*(ST will always access the environment registers +instead of the process environment when it needs to evaluate +an environment variable internally. +Furthermore, when spawning subprocesses, \*(ST will export +all Q-Registers beginning with \(lq$\(rq that do not have +a \(lq=\(rq in their name into the subprocess environment. +Therefore, the subset of Q-Registers whose name begins with \(lq$\(rq +can be considered practically identical to the process environment +and \*(ST macros can access, modify and extend the environment using +these registers. +.LP +The following environment variables and registers are initialized with +default values by \*(ST if they are unset: .TP .B HOME Home directory of the current user. -This may be used e.g. by the \fBFG\fP command. +This may be used e.g. by the \fBFG\fP command and for +tilde-expansions. If unset, it defaults to the current user's home directory as set by .BR passwd (5) @@ -191,7 +203,7 @@ defaults to the standard library installation path at . .LP The \fBHOME\fP, \fBSCITECOCONFIG\fP and \fBSCITECOPATH\fP environment -variables are canonicalized to absolute paths. +variables and registers are canonicalized to absolute paths. Therefore it is possible to define them relative to the working directory of \*(ST when it starts up while macros can work with the corresponding registers to locate files |