From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "stuart.tett@gmail.com" Newsgroups: gmane.emacs.help Subject: Re: is it possible to pass shell variables to emacs? Date: Fri, 7 Dec 2007 09:13:28 -0800 (PST) Organization: http://groups.google.com Message-ID: <05d07222-2a31-4399-90eb-63a0230a386a@s12g2000prg.googlegroups.com> References: <44a8858b-32d1-4b14-803f-4cded782b968@a39g2000pre.googlegroups.com> <85lk87o3i9.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197049239 14169 80.91.229.12 (7 Dec 2007 17:40:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2007 17:40:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 07 18:40:48 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0hBu-0000sy-Lo for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Dec 2007 18:40:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0hBd-0005BH-KB for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Dec 2007 12:40:29 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s12g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: 208.71.56.11 Original-X-Trace: posting.google.com 1197047608 622 127.0.0.1 (7 Dec 2007 17:13:28 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 7 Dec 2007 17:13:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s12g2000prg.googlegroups.com; posting-host=208.71.56.11; posting-account=kVXI5QoAAABVyFocW0ORjUYeX2nxhaP0 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.0.10) Gecko/20070221 Red Hat/1.5.0.10-0.1.el4 Firefox/1.5.0.10, gzip(gfe), gzip(gfe) X-HTTP-Via: 1.1 mold.dreamworks.com:3128 (squid/2.5.STABLE5) Original-Xref: shelby.stanford.edu gnu.emacs.help:154484 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49914 Archived-At: On Dec 6, 2:35 pm, David Kastrup wrote: > "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.