Re: (no subject)

Eric Ludlam <[email protected]> Sun, 02 Aug 2015 07:48:51 -0400
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
On 06/08/2015 05:15 PM, Matthias Meulien wrote:
> Eric Ludlam <[email protected]> writes:
>> (...) Since you are interested in the way it handles import, I'd first
>> like to suggest you enable
>> (global-semantic-decoration-mode 1)
>> which will give you a quick way to see how it is finding your imports.
>
> Yes. In fact I always have `global-semantic-decoration-mode' on: I like it.
>
> So here is what I have done so far. First I have read the definition of
> `semantic-python-get-system-include-path' and I have checked that
> customizing `semantic-python-dependency-system-include-path' works as
> expected: If I add the path to a virtual environment with a package not
> available globally, then imports referring to that packages are well
> handled.
>
> Then I remembered that `python-shell-virtualenv-root' (the variable used
> to setup Python mode to use virtual environments) is supposed to be used
> as a local variable. Thus a solution could be based on
> `semantic-python-dependency-system-include-path' being a local variable
> too.
>
> I tried to turn it to a per directory local variable (using
> `add-dir-local-variable') but it had no effect on imports referring to a
> package not available globally are still unknown...

Sorry for a long delay in replying.  My wife introduced me to a long and 
very interesting series of books.  ;)

I'm not sure how dir local variables will interact with CEDET;s mode 
local and project local variables, and the system-include-path concept.

The way I usually handle directory specific values is to provide them 
via EDE.  There are currently no EDE project styles that are good for 
python, nor python specific ways to setup paths in the core.  Your 
python specific project would implement ede-system-include-path which is 
appended to the variable you noted.

If python projects have a concept of a dominating file (Like a Makefile 
in C, or a built.xml for ant) it would be simple to make an EDE projet 
to provide path specific values derived from something like.  You can 
probably use ede-cpp-root, and just setup the includes for python to 
experiment to make sure they hook together.

I'm not familiar with python or how it should behave.  If you have a 
simple example, I can help debug a little, and could add it to my test 
suite.

Eric

------------------------------------------------------------------------------