[Top][All Lists]

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

Re: is it possible to pass shell variables to emacs?

From: David Kastrup
Subject: Re: is it possible to pass shell variables to emacs?
Date: Thu, 06 Dec 2007 23:35:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

"address@hidden" <address@hidden> writes:

> is there any possible way to do this? I would like to avoid making
> them environment variables. I have a command-line script that when
> called, sets all of these variables. I would like to use these
> variables for example when finding a file.
> Maybe there's some custom code I could put in my .emacs file. or I
> could write a wrapper around emacs.

emacs -eval '(setq a (pop argv) b (pop argv))' "$a" "$b"

If your Emacs version is not a more recent developer version, you need
to write command-line-args-left instead of argv.  This is to be
preferred to

emacs -eval "(setq a \"$a\" b \"$b\")"

since this will break if $a or $b contain characters or character
sequences that are interpreted specially in literal Lisp strings.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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