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: "source" shell commands Date: Sat, 24 Mar 2007 15:35:22 +0100 Organization: Organization?!? Message-ID: <85wt16btg5.fsf@lola.goethe.zz> References: <87bqii936r.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1174747150 23793 80.91.229.12 (24 Mar 2007 14:39:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 24 Mar 2007 14:39:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 24 15:39:03 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 1HV7OX-0002yR-1w for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Mar 2007 15:39:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HV7QY-0001zw-93 for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Mar 2007 09:41:06 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!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.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux) Cancel-Lock: sha1:3YInRxB/aAViOmmzZbwoyxubCU8= Original-Lines: 27 Original-NNTP-Posting-Date: 24 Mar 2007 15:35:28 CET Original-NNTP-Posting-Host: 48e164d1.newsspool4.arcor-online.net Original-X-Trace: DXC=\aLJ@?4mn0T?4IUKCV`H8_`hhQ4^9QSCVg3dO6WWeM98lmYo:@j`l^E9Omf9f?FS7T=>hQ5 Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: shelby.stanford.edu gnu.emacs.help:146556 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:42160 Archived-At: Tassilo Horn writes: > 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") "\"")) > > Sure. > > --8<---------------cut here---------------start------------->8--- > (defun mf-source (file) > (interactive "f") > (shell-command (concat "source \"" file "\""))) > --8<---------------cut here---------------end--------------->8--- Quoting is always good for trouble. I'd rather use (defun mf-source (file) (interactive "f") (call-process shell-file-name nil nil nil "source" file)) assuming that you don't care about the output. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum