From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: "source" shell commands Date: Sun, 25 Mar 2007 12:32:54 +1000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87lkhmqch5.fsf@lion.rapttech.com.au> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1174790309 25886 80.91.229.12 (25 Mar 2007 02:38:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 25 Mar 2007 02:38:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 25 04:38:23 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 1HVIch-00050J-Eq for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Mar 2007 04:38:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HVIem-0004yX-59 for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Mar 2007 21:40:32 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!syros.belnet.be!news.belnet.be!feeder.news-service.com!138.199.65.86.MISMATCH!sn-xt-ams-06!sn-xt-ams-08!sn-post-ams-02!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) Cancel-Lock: sha1:3IAlZCCV+l8rFCFlYC1t5onwQuo= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 31 Original-Xref: shelby.stanford.edu gnu.emacs.help:146566 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:42170 Archived-At: Matthew Flaschen writes: > Is there an elisp function to "source" a shell file; i.e. an alternative > to: > > (shell-command (concat "source \"" (expand-file-name "~/.rc") "\"")) > > Matthew Flaschen > > Hi Matt, just wondering why you would want this? The point of sourcing a shell file is to allow for the file to execute in the current (callers) shell environment. For example, to allow all subsequent sub-shells to inherit from that parent - useful for setting envrionment variables etc. However, I cannot see this being of any real use from inside emacs. No matter what way you call it, emacs will spawn a sub process to execute the command. Once it exits, everything is lost. However, I'll readily admit I may be missing some application/reason and am just curious. To answer your question, there are no existing commands that I know of which will do what you want. However, it wold only take about 5 lines of elisp to create your own. Tim -- tcross (at) rapttech dot com dot au