From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: is it possible to pass shell variables to emacs? Date: Thu, 06 Dec 2007 23:35:42 +0100 Organization: Organization?!? Message-ID: <85lk87o3i9.fsf@lola.goethe.zz> References: <44a8858b-32d1-4b14-803f-4cded782b968@a39g2000pre.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196980862 6081 80.91.229.12 (6 Dec 2007 22:41:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2007 22:41:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 06 23:41:11 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 1J0POg-0001lk-C7 for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Dec 2007 23: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 1J0POP-0006Ud-Gf for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Dec 2007 17:40:29 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.news-service.com!border1.nntp.ams.giganews.com!nntp.giganews.com!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:Qd2C8tFQBfvYHaqLTop647FXI+Y= Original-Lines: 23 Original-NNTP-Posting-Date: 06 Dec 2007 23:35:16 CET Original-NNTP-Posting-Host: 40ba6059.newsspool3.arcor-online.net Original-X-Trace: DXC=je9; 1O0E]; =Tia]Ho99G50McF=Q^Z^V384Fo<]lROoR14nDHegD_]R5_E\UZ6>A2?1CV`H8_`hhQ4^9QSCVg3dO6OIC5DBZVJ9; XKc=EMo9=<>fh\BIg[gdj2 Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: shelby.stanford.edu gnu.emacs.help:154473 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:49900 Archived-At: "stuart.tett@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