help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems starting emacs with correct environmental settings


From: Pascal J. Bourguignon
Subject: Re: Problems starting emacs with correct environmental settings
Date: Fri, 03 Jul 2009 12:08:24 +0200
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/22.2 (gnu/linux)

Alain Muls <alain.muls@telenet.be> 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__


reply via email to

[Prev in Thread] Current Thread [Next in Thread]