Subject: Proposed patch to nt/runemacs.c: a way to augment environment variables prior to starting Em

From: Evgeny Roubinchtein <[email-masked]>
Date: Wed, 14 Oct 2015 18:59:26 -0700

Dear Emacs developers,

Would you consider applying the attached patch to nt/runemacs.c?

My "use case" is that I compiled 64-bit Emacs under Windows following
instructions at
http://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/,
but I want to avoid copying libraries from ${msys2_root}/mingw64/bin
to the Emacs installation directory, and I also don't want to add
${msys2_root}/mingw64/bin to the PATH for my user account (let alone
system-wide).  The attached patch gives me a way to augment system
environment variables before runemacs starts the actual emacs
executable.

With this patch applied, I can set the environment variable EMACS_ENV
to ">PATH>${msys2_root}/mingw64/bin", and have that directory appended
to the PATH but only in the environment of the runemacs process.  That
environment is inherited by the emacs process, so I can allow Emacs to
find the libraries it needs in order to run without copying them to
the Emacs installation directory and without altering the PATH for my
user account.

Please let me know if it would be possible to get this patch applied
to the Emacs sources.

Thank you in advance!