From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: is it possible to pass shell variables to emacs?
Date: Sun, 09 Dec 2007 17:19:29 +1100 [thread overview]
Message-ID: <8763z8s83y.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: 05d07222-2a31-4399-90eb-63a0230a386a@s12g2000prg.googlegroups.com
"stuart.tett@gmail.com" <stuart.tett@gmail.com> writes:
> 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
>
Maybe if you can elaborate more on what you want as your outcome we can
provide better solutions. It could be that existing packages will do what
you want more easily and consistently and with added features. For example,
emacs has support for setting default path lists to look for files, finding
files based on information such as what is around point, relative to a
dired buffer or as part of a fileset etc. Maybe a simple load hook could do
what you want etc. Emacs is very feature rich and a lot of very useful
features need to be configured/enabled to get them working because there is
no obvious defaults or because they may cause confusion unless explicitly
asked for etc.
--
tcross (at) rapttech dot com dot au
next prev parent reply other threads:[~2007-12-09 6:19 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
2007-12-07 17:18 ` David Kastrup
2007-12-07 17:59 ` Joel J. Adamson
2007-12-09 6:19 ` Tim X [this message]
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=8763z8s83y.fsf@lion.rapttech.com.au \
--to=timx@nospam.dev.null \
--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).