help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting enviromment variable


From: Anselm Helbig
Subject: Re: setting enviromment variable
Date: Wed, 26 Aug 2009 16:18:46 +0200

Hallo!

> setting environment variables does not work anymore.
> I do it like this:
> 
> ;; ledger file variable
> (setenv "LEDGER_FILE" (concat (getenv "LEDGER_FILE") "~/ledger/ledger.dat"))
> ;; printer variable
> (setenv "PRINTER" (concat (getenv "PRINTER") "HL2030"))

What this does is that it adds to what is already stored in the
environment variable. If you just want to set the value, you'd do it
like this:

  (setenv "LEDGER_FILE" "~/ledger/ledger.dat")
  (setenv "PRINTER" "HL2030")

Adding to an environment variable only makes sense for PATH and
friends.

> Evaluating produces:
> 
> "~/ledger/ledger.dat~/ledger/ledger.dat~/ledger/ledger.dat~/ledger/ledger.dat"
> "HL2030HL2030HL2030HL2030"

Looks like the code ran four times. 8-)

HTH, 

Anselm


-- 
Anselm Helbig 
mailto:address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]