delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/10/18/18:35:53

DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 49IMZqDr1100009
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=iwX3OCiJ
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6E9D385828E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1729290950;
bh=fUy4VmTSBITZQXcUapZvEwcyRHpmIA+i1XEShkWxpa8=;
h=Date:Subject:To:References:Cc:In-Reply-To:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=iwX3OCiJoiLkmdoFk3W5WnOcOayNnxywKiBHJQDtPZUvbzYPtliN961nWoagPJRqm
DBH5Eat7vvBHMHz6YJ5aYHv4AoI5FIbHNonpyyV9hqGijIT8x+2Ts3mkzpSThj543V
pu4Qo8DrsStHbhR1jXkDD9sgI362kYki7OdZfO+o=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 84FFF3858C42
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 84FFF3858C42
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729290924; cv=none;
b=safJ59d1Nmp+yYz6frmyzlSp3eohg5EVUqIyRwy+XVsj/HyuC1TlWoMOmTjmqQPN7rtp086qJnwSjtnhmOP/XxaNDD4DkI5mMtfpvECziObqMAannscXp8cF5MoG9Gc5Z2IJuQkkmoTWl92aju+xTwrkhhyAk2AV5dhQZ1d4GUw=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1729290924; c=relaxed/simple;
bh=OxYFCV8Ys/vaqO2rsqovattVYbsnvjj+AaUX7CwTbSc=;
h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From;
b=K9N+iP54gJladDYG1fOreGrsfn7ksW8vKhmNXEDWh7G+eFpncutCX7SaPLEQ4smqCmahqthwt2+SnqtLYJ5ZKSqC5dHABnyjwK8yvD3GCMTO77HTZ5xt4pF/7PLdLzFQRUoLzLPhrnp7aXbBKJ6+Z2VgsLb15F6NZq4pHKoS3yQ=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-ASG-Debug-ID: 1729290888-24039d6cb5ab4c40001-w5GHUG
X-Barracuda-Envelope-From: moss AT cs DOT umass DOT edu
X-Barracuda-RBL-Trusted-Forwarder: 128.119.240.136
DKIM-Filter: OpenDKIM Filter v2.11.0 mailsrv.cs.umass.edu C52EA5BDC8
X-Barracuda-RBL-Trusted-Forwarder: 172.27.236.93
Message-ID: <83bc0d7c-5336-1280-b2ae-941417f87189@cs.umass.edu>
Date: Fri, 18 Oct 2024 18:34:46 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Subject: Re: How to wrap emacs startup with application that dynamically sets
particular environment variables?
X-ASG-Orig-Subj: Re: How to wrap emacs startup with application that
dynamically sets particular environment variables?
To: "KARR, DAVID" <dk068x AT att DOT com>
References: <DM3PR02MB102569F13FAE2FBB1163E4E259D402 AT DM3PR02MB10256 DOT namprd02 DOT prod DOT outlook DOT com>
Cc: cygwin <cygwin AT cygwin DOT com>
In-Reply-To: <DM3PR02MB102569F13FAE2FBB1163E4E259D402@DM3PR02MB10256.namprd02.prod.outlook.com>
X-Barracuda-Connect: mailsrv.cs.umass.edu[128.119.240.136]
X-Barracuda-Start-Time: 1729290888
X-Barracuda-Encrypted: TLS_AES_256_GCM_SHA384
X-Barracuda-URL: https://barramail.cs.umass.edu:443/cgi-mod/mark.cgi
X-Barracuda-BRTS-Status: 1
X-Virus-Scanned: by bsmtpd at cs.umass.edu
X-Barracuda-Scan-Msg-Size: 1581
X-Barracuda-Spam-Score: 0.00
X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0
QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.7 tests=
X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.131979
Rule breakdown below
pts rule name description
---- ---------------------- --------------------------------------------------
X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, JMQ_SPF_NEUTRAL, NICE_REPLY_A, SPF_HELO_NONE,
SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Eliot Moss via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Eliot Moss <moss AT cs DOT umass DOT edu>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On 10/18/2024 5:36 PM, KARR, DAVID via Cygwin wrote:
> I'm looking at a situation where I'm going to need to write a small application that takes a command line to run, but first gets some data from an external source and sets environment variables from the response, so those variables are set in the subshell it starts.  It would be straightforward to add this to a command line that I run in the shell, but I'd really like to wrap this with my running of Emacs itself.  I currently use the following in my Emacs shortcut:
> 
>      C:\cygwin64\bin\run2.exe --display 127.0.0.1:0.0 /usr/local/bin/emacs.xml
> 
> I see that the "emacs.xml" file allows for some static environment variable values, but that won't help me.  If I simply change the shortcut to this:
> 
>      mywrapper C:\cygwin64\bin\run2.exe --display 127.0.0.1:0.0 /usr/local/bin/emacs.xml
> 
> Where "mywrapper" is the application I'm writing to get the env var settings, will that result in those environment variables being put into the environment of each shell buffer I start from Emacs?
> 

Section C.4 of the online emacs manual syas:

"Subprocesses of Emacs (such as shells, compilers, and version control programs) inherit the environment from Emacs, too."

You can use Emacs functions to change the emacs's environment variables, which would then change what's passed to 
subprocesses (AFAICT).  Emacs saves its *initial* environment, so if you're sensitive to what was passed in, you can 
look there.

That's what I was able to find without digging really deep ...  Eliot Moss



-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019