On Fri, Dec 5, 2008 at 3:44 AM, Eric M. Ludlam <eric@siege-engine.com> wrote:
>>> Wei Weng <wweng@acedsl.com> seems to think that:
>bread wrote:
 [ ... ]
>> > (semantic-add-system-include "/usr/include/" 'c++-mode)
>How do I go about adding multiple system include directories?
 [ ... ]

You can call `semantic-gcc-setup' to get it to work automatically if
you use GCC.  This happens automatically if you are on a known GNU
platform, such as gnu/linux.  If not, you can add multiple includes as in
the example above, such as:

(semantic-add-system-include "/usr/include/" 'c-mode)
(semantic-add-system-include "/usr/include/X11" 'c-mode)
(semantic-add-system-include "/usr/include/Xt" 'c-mode)

So, if one directory full of header files is neither declared here using (semantic-add-system-include ...), nor in the same directory as the file i'm editing, and If i'm not using EDE, Is semantic capable to find the completions?

I'm confused because sometimes i found it chould, sometimes not. So what is the mechanism of semantic for looking up the completions? In my opinion, it might do like this:

1. analyze current buffer to find out the type of the symbol you want to get completions for.
2. start looking up in the directories below for all the header files included by current buffer (both direct includes and indirect includes)
    1) system include directory (gcc inlcudes and explicitly declared ones using semantic-add-system-include)
    2) the same directory of current editing file
    3) EDE project include path if it is used.
3. If found, then give the possible completions. Or tell the users there's none.

Am i right?

Zhiqiu Kong (孔直秋)