From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: Problems starting emacs with correct environmental settings Date: Fri, 03 Jul 2009 12:08:24 +0200 Organization: Anevia SAS Message-ID: <7c8wj6gjtz.fsf@pbourguignon.anevia.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1246618267 18502 80.91.229.12 (3 Jul 2009 10:51:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jul 2009 10:51:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 03 12:51:00 2009 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 1MMgLu-0001a0-PC for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2009 12:50:48 +0200 Original-Received: from localhost ([127.0.0.1]:57600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMgLu-0006BN-23 for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2009 06:50:46 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!cleanfeed4-a.proxad.net!nnrp10-2.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.101 (Gnus v5.10.10) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:287olhJWg3qrTCnrdWIcXWoTcek= Original-Lines: 49 Original-NNTP-Posting-Date: 03 Jul 2009 12:08:24 MEST Original-NNTP-Posting-Host: 88.170.236.224 Original-X-Trace: 1246615704 news-2.free.fr 32762 88.170.236.224:40231 Original-X-Complaints-To: abuse@proxad.net Original-Xref: news.stanford.edu gnu.emacs.help:170545 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:65755 Archived-At: Alain Muls writes: > Hi emacs users, > > On my ubuntu system I have in the top bar the icon (dragged from the > menu entry in Accessories) to launch emacs. By doing so, I have no > access to my PATH variable, eg. a compile (make -k) won't run. > > When I launch emacs from a shell, than there is no problem and make or > other scripts are available. What should I do to have the icon launch > emacs with my PATH set. If you answer Peter's questions, you will learn that environment variables are inherited from parent process to child process, (some programs do clean up environment variables before forking a child, but normal programs leave them pass from parent to grand-child). So ultimately, it depend on the process that forks emacs. This is the "desktop manager" (does something like KDE, Gnome, GNUstep Workspace Manager, etc, ring a bell?). Some of these desktop managers may provide a preference panel to set the environment variables for the child processes. Or they may load them from a special file or store. So if you identify your desktop manager, you may try to find this file or this preference and set it. Otherwise, you could set the environment in the process that launches the desktop manager. When you log in with X, the login window manager restarts the X server which will execute some script to fork your window manager, desktop manager, etc. Various user scripts may be used, like ~/.xsession or ~/.xinitrc, depending on the login window manager you use or how you start X. In the absence of user scripts, default scripts in /etc/X11/* are used. Depending on the shell used by these scripts, you may edit one of the file used by these shell to set the environment. Eg. in case of bash, you could set your environment in ~/.bash_env or ~/.bash_login or ~/.bashrc ; for other Bourne shells, ~/.profile or ~/.login could be used. In the last resort, you can directly edit the X startup scrip that is used in your configuration. You may follow the login process by starting from /etc/inittab, and following the track of the programs/processes. -- __Pascal Bourguignon__