Eric M. Ludlam wrote:
Hi,

The intention is for what you did to work, though I don't doubt that there may be some initialization issue.  For now, you can probably just add:

(require 'semantic-c)

just before your commands to add the system include files.  Hopefully I, or someone else may figure out why it doesn't work the other way soon.

Eric

Chris wrote:
I have this in my .emacs:
(semantic-add-system-include "~/work/c/bash-src/bash-3.2/bash-3.2/" 'c-mode)

But if I open a .c file, and check the variable semantic-dependency-system-include-path(C-h f semantic-add-system-include tells me it will modify this variable):
Its value is
("/usr/local/include/" "/usr/lib/gcc/i486-linux-gnu/4.3.4/include/" "/usr/lib/gcc/i486-linux-gnu/4.3.4/include-fixed/" "/usr/include/i486-linux-gnu/" "/usr/include/")

There isn't the directory I want to add into the system include path. If I opened the .c file first, and evaluate the statement above, the directory would then be added.
Do I use semantic-add-system-include wrong?

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev _______________________________________________
cedet-semantic mailing list
cedet-semantic@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-semantic

I put only these lines in my .emacs:

(setq semantic-load-turn-everything-on t)
(load-file "/home/chris/.emacs.d/lisp/cedet/common/cedet.el")
(semantic-load-enable-excessive-code-helpers)
(semantic-add-system-include "~/work/c/bash-src/bash-3.2/bash-3.2/" 'c-mode)
(print (mode-local-value 'c-mode 'semantic-dependency-system-include-path))
(semantic-add-system-include "~/work/c/bash-src/bash-3.2/bash-3.2/" 'c++-mode)
(print (mode-local-value 'c++-mode 'semantic-dependency-system-include-path))

and it prints "~/work/c/bash-src/bash-3.2/bash-3.2/" twice which I expect.
Buf after I open a .c or .cpp file, the value of semantic-dependency-system-include-path in each mode changes.
In c-mode:
("/usr/local/include/" "/usr/lib/gcc/i486-linux-gnu/4.3.4/include/" "/usr/lib/gcc/i486-linux-gnu/4.3.4/include-fixed/" "/usr/include/i486-linux-gnu/" "/usr/include/")

In c++-mode:
("~/work/c/bash-src/bash-3.2/bash-3.2/" "/usr/include/c++/4.3/" "/usr/include/c++/4.3/i486-linux-gnu/" "/usr/include/c++/4.3/backward/" "/usr/local/include/" "/usr/lib/gcc/i486-linux-gnu/4.3.4/include/" "/usr/lib/gcc/i486-linux-gnu/4.3.4/include-fixed/" "/usr/include/i486-linux-gnu/" "/usr/include/")

I think some function may overwrite the value of semantic-dependency-system-include-path in c-mode.
But I don't know how to solve this problem. Could any one help?