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

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

Re: Compile mode in emacs!!


From: Peter Dyballa
Subject: Re: Compile mode in emacs!!
Date: Wed, 28 Mar 2007 13:17:12 +0200


Am 28.03.2007 um 12:28 schrieb Nazir:

1. PATH variable is showing the correct value in the terminal ( tcsh ). From the same terminal I open emacs. In emacs, I execute the shell command, echo $PATH, this shows an incorrect value.

What is your login shell? Without some basics nothing reasonable can be achieved.

What is your command to "open emacs?"
Do you have a file ~/.emacs_tcsh? This one sets values for GNU Emacs' *shell* buffer – but not for what is done via M-x. In case your login shell is tcsh, then ~/.cshrc is executed, when it exists. If it does not exist, then ~/.tcshrc is executed, if existing. And it is this order in which they are loaded, or not loaded (you can proof by creating a simple ~/.cshrc with only one line

        echo "Hi, it's me, your ~/.cshrc!"

). Do they manipulate path? The lower case word ``path´´ is the variable that sets PATH, which exists in (t)csh only for backward compatibility with Bourne shell look-alikes.

2. In the RC file (.cshrc), the PATH has already been set to correct value(I guess thats how it is displayed properly in the terminal). I just wonder where emacs gets the PATH from ?? Does it take it from a different file??

If the GNU Emacs binary is launched from a shell as 'emacs &' than no other file is involved in setting PATH – except you have in some ELisp file a statement like

        (setenv "PATH" (concat "/some/directory" ":" (getenv "PATH")))

or such. This modulates GNU Emacs' internal private environment which is then copied into every new process, like for example the compilation process.

If the 'emacs' from 'emacs &' is a shell script, than this shell script can re-set PATH for the GNU Emacs launched later from this script.


This code in site-start.el can name in *Messages* buffer all ELisp files loaded:

        (defadvice load (before debug-log activate)
          (message "(Tipp von Kai G) Now loading: %s" (ad-get-arg 0)))

You can use some for GNU Emacs options to make it not loading ELisp files, -q or -Q. Check with 'emacs --help' for the exact meaning! You might be able to find circumstances under which GNU Emacs' environment is correct.


In Mac OS X I have it very simple and comfortable: an XML file contains environment variables and their values and by a command like

            set path=(`defaults read ~/.MacOSX/environment PATH | tr ':' ' '`)

I can use them in any shell ...

--
Greetings

  Pete

When you meet a master swordsman,
show him your sword.
When you meet a man who is not a poet,
do not show him your poem.
                -- Rinzai, ninth century Zen master






reply via email to

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