unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "stuart.tett@gmail.com" <stuart.tett@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: is it possible to pass shell variables to emacs?
Date: Fri, 7 Dec 2007 09:13:28 -0800 (PST)	[thread overview]
Message-ID: <05d07222-2a31-4399-90eb-63a0230a386a@s12g2000prg.googlegroups.com> (raw)
In-Reply-To: 85lk87o3i9.fsf@lola.goethe.zz

On Dec 6, 2:35 pm, David Kastrup <d...@gnu.org> wrote:
> "stuart.t...@gmail.com" <stuart.t...@gmail.com> 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


Great thanks. Question: some of these variables that I am passing in
refer to directories and I want to use them in the C-x C-f interface.
How do I access them? I don't think they work with $myvar

Thanks.

  reply	other threads:[~2007-12-07 17:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-06 19:38 is it possible to pass shell variables to emacs? stuart.tett
2007-12-06 22:35 ` David Kastrup
2007-12-07 17:13   ` stuart.tett [this message]
2007-12-07 17:18     ` David Kastrup
2007-12-07 17:59     ` Joel J. Adamson
2007-12-09  6:19     ` Tim X
2007-12-09  6:10 ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05d07222-2a31-4399-90eb-63a0230a386a@s12g2000prg.googlegroups.com \
    --to=stuart.tett@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).