From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tak Ota Newsgroups: gmane.emacs.devel Subject: Re: sourcing environment Date: Wed, 11 Oct 2006 09:07:45 -0700 (PDT) Organization: Sony Electronics Inc. Message-ID: <20061011.090745.01371169.Takaaki.Ota@am.sony.com> References: <20061010.150956.91284903.Takaaki.Ota@am.sony.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1160583513 1259 80.91.229.2 (11 Oct 2006 16:18:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Oct 2006 16:18:33 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 11 18:18:30 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GXgld-0005Mm-2t for ged-emacs-devel@m.gmane.org; Wed, 11 Oct 2006 18:17:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXglc-0001aW-9J for ged-emacs-devel@m.gmane.org; Wed, 11 Oct 2006 12:17:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GXgdu-00088j-Uh for emacs-devel@gnu.org; Wed, 11 Oct 2006 12:09:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GXgdr-00083N-J1 for emacs-devel@gnu.org; Wed, 11 Oct 2006 12:09:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXgdr-000834-Cd for emacs-devel@gnu.org; Wed, 11 Oct 2006 12:09:11 -0400 Original-Received: from [62.209.45.174] (helo=outbound2-fra-R.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GXgls-0006j8-Tk for emacs-devel@gnu.org; Wed, 11 Oct 2006 12:17:29 -0400 Original-Received: from outbound2-fra.bigfish.com (localhost.localdomain [127.0.0.1]) by outbound2-fra-R.bigfish.com (Postfix) with ESMTP id B77BF9488D7; Wed, 11 Oct 2006 16:03:30 +0000 (UTC) Original-Received: from mail13-fra-R.bigfish.com (unknown [10.4.252.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by outbound2-fra.bigfish.com (Postfix) with ESMTP id B5F0673805C; Wed, 11 Oct 2006 16:03:30 +0000 (UTC) Original-Received: from mail13-fra (localhost.localdomain [127.0.0.1]) by mail13-fra-R.bigfish.com (Postfix) with ESMTP id C099BB602C4; Wed, 11 Oct 2006 16:12:33 +0000 (UTC) X-BigFish: V Original-Received: by mail13-fra (MessageSwitch) id 1160583074969982_16153; Wed, 11 Oct 2006 16:11:14 +0000 (UCT) Original-Received: from mail8.fw-bc.sony.com (mail8.fw-bc.sony.com [160.33.98.75]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail13-fra.bigfish.com (Postfix) with ESMTP id AACE5958105; Wed, 11 Oct 2006 16:11:13 +0000 (UTC) Original-Received: from mail1.sgo.in.sel.sony.com (mail1.sgo.in.sel.sony.com [43.130.1.111]) by mail8.fw-bc.sony.com (8.12.11/8.12.11) with ESMTP id k9BG7ksT006288; Wed, 11 Oct 2006 16:07:46 GMT Original-Received: from localhost (us00130290172a.am.sony.com [43.191.14.104]) by mail1.sgo.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id k9BG7k7m010646; Wed, 11 Oct 2006 16:07:46 GMT Original-To: stephen_leake@member.fsf.org In-Reply-To: X-Telephone: +1-858-942-3239 X-Fax------: +1-858-942-9142 X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804 X-Mailer: Mew-5.1.50 on Emacs-22.0.50.1 (i386-mingw-nt5.1.2600 built on 2006-10-09) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60608 Archived-At: Thanks for the suggestion. I understand what you do but in my case I don't prepare the shell scripts but they come as a part of software development kit from system silicon vendors. I used to hand translate those shell scripts into custom elisp functions like you show below but that soon got too cumbersome to maintain for multiple platforms. What I want to automate is the following process without loosing the currently opened buffers. M-x kill-emacs $ source env-xxx.sh $ emacs -Tak Wed, 11 Oct 2006 04:35:16 -0400: Stephen Leake wrote: > Tak Ota writes: > > > ... When switching gears frequently between different cross > > compilation environment it is common practice to set/change > > environment variables by sourcing shell scripts. > > I don't use shell scripts for this; I use Emacs functions: > > (defun ghdl-0.25 () > "ghdl only; run from a DOS shell" > (interactive) > (setq exec-path > (list > (expand-file-name "~/bin") > (getenv "INSTALL_BIN") > "c:/Gnu/Emacs/emacs-21.3/bin" > "c:/Gnu/Ghdl-0.25/bin" > "c:/Windows/system32")) > (setenv "PATH" (mapconcat 'identity exec-path path-separator)) > ) > > (defun sal-no-network () > "set LM_LICENSE_FILE to just the hardware key, to avoid network delays" > (interactive) > (setenv "LM_LICENSE_FILE" "foo") > ) > > -- > -- Stephe >