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: Emacs Environment Variables Date: Sun, 25 Nov 2007 17:02:32 +1100 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87myt2zwuf.fsf@lion.rapttech.com.au> References: <7e3068b0-defa-4b37-9092-182b521f5f50@e23g2000prf.googlegroups.com> <3568102A-B060-4D1F-B7B5-7944386B07A9@Web.DE> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195972917 29201 80.91.229.12 (25 Nov 2007 06:41:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2007 06:41:57 +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 Nov 25 07:42:05 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 1IwBBq-0003cn-N0 for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 07:42:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwBBb-00009H-WB for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 01:41:48 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.247.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!newspeer1.nwr.nac.net!border2.nntp.dca.giganews.com!nntp.giganews.com!sn-xt-sjc-05!sn-xt-sjc-07!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/23.0.50 (gnu/linux) Cancel-Lock: sha1:YJyemRECU7LNDzZpITXA5kmzCPA= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 65 Original-Xref: shelby.stanford.edu gnu.emacs.help:154060 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:49492 Archived-At: Ismael Valladolid Torres writes: > Peter Dyballa escribe: >> Do you start bash in a way that it executes your .bashrc? > > I am afraid he means running emacs from an icon in its window manager > menu. Then it doesn't honor .bashrc, as it wasn't run from a bash > session. > Actually, I think the issue isn't so much that its not run from a bash/sh session, but rather the parent process was not a login session and running from a menu option isn't interpreted as an interactive bash shell. > If running Debian or Ubuntu he could move important env definitions > into /etc/environment. I am sure there are ways to do this on Fedora > or Mandriva systems. > However, you need to keep a couple of things in mind when adding environment variables to /etc/environment. 1. This file is sourced by *all* processes when they start, not just a specific users processes. If you put something like HOME=/path/to/my/home/directory this could cause all sorts of problems for other users or system processes that have/expect $HOME to point somewhere else (or at least somewhere the process has access to. 2. This file is sourced before any login or shell init files, which means anything set here may be over written, possibly a good thing or a bad thing and definitely a possible gotcha when trying to debug a problem. I think its a good idea only to put things in this file which are common to all processes - possibly things like locale settings. There are a number of ways to resolve the issue of programs started from a wm menu inheriting user environment variables. One of the simplest is to just change your Xsession to run as a login shell. As this is the parent session, all exported environment variables will be inherited by all processes you start while in X regardless of whether they are from a wm menu, an xterm or some other 'launcher'. How you do this depends on the way you start X. I have my system boot into X and run gdm. For me, it would be as easy as changing /etc/gdm/Xsession to be a login shell rather than a non-interactive sh shell (I'm on Debian). some window managers allow you to tick a box when defining a menu entry that essentially makes the process that will execute the menu item source the users init files, such as .bash_profile or .profile. If you can't do this with your wm, you can just make a simple wrapper script that sources your init files and then exec's emacs. Finally, you can create your own .xsession file and just have it source your init files. HTH Tim -- tcross (at) rapttech dot com dot au