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

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

Re: accessing environment variable


From: Harald Hanche-Olsen
Subject: Re: accessing environment variable
Date: Tue, 11 Sep 2007 00:10:31 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix)

+ Stephan Hennig <mailing_list@arcor.de>:

> Drew Adams schrieb:
>
>> 1. (getenv "GS_PROG")
>> See doc above: "Variable should be a string."
>
> Thanks.
>
>
>>> (custom-set-variables '(ps-lpr-command "(getenv GS_PROG)")
>> 
>> 2. ps-lpr-command expects a string that names a program. It does not expect
>> a Lisp sexp.
>
> Does that mean there is no way to feed the value of an environment
> variable into ps-lpr-command (same for doc-view-ghostscript-program)?

No.  I am not intimately familiar with the customization system on
emacs, but you can certainly do it by including

  (setq ps-lpr-command (getenv "GS_PROG"))

in your .emacs file.

Things get a bit trickier if those environment variables don't just
name a program, but names program arguments as well.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


reply via email to

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