* bug#6231: 23.2; ede-cpp-root-projects spp table is not taken into account by semantic in cedet
@ 2010-05-20 14:03 Jonathan Marchand
2010-05-24 11:53 ` Jonathan Marchand
2010-05-26 17:50 ` bug#6231: " Jonathan Marchand
0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Marchand @ 2010-05-20 14:03 UTC (permalink / raw)
To: 6231
[-- Attachment #1: Type: text/plain, Size: 2825 bytes --]
Hi,
I can't find a way to make the autocompletion fully works with semantic in
emacs 23.2 with the built-in CEDET. This happens in the debian packaged
version, the release tarball and in the last bazaar snapshot of emacs23.2.
The reason is that the include filen are not parsed with the needed #define.
I found one reason for that to happen.
When loading a file located in a ede-cpp-root-project, the spp-table
preprocesser symbols are not taken into account by semantic. By browsing the
code, I find the problem :
In file lisp/cedet/ede/cpp-root.el, in the function ede-set-project-variables
(called when you load a file within a ede-cpp-root-project), the semantic
spp-table needs semantic/c and semantic/lex-spp to be loaded to get the symbols
defined in the ede-cpp-root-project.
However, no file elisp file provides semantic/c (and thus it's always evaluated
as nil). In the original CVS version of CEDET, this function waits for
semantic-c, which is provided by the semantic/bovine/semantic-c.el file. In the
emacs23.2 distribution, this file is renamed semantic/bovine/c.el and provides
semantic/bovine/c. If I replace semantic/c by semantic/bovine/c, the semantic
spp-table is updated correctly (furthermore I need to eval
(require 'semantic/bovine/c) before loading the files in the project, it seems
that this file is not evaluated when calling semantic-mode).
This bug is due to a bad translation from original package to the built-in
emacs one.
Here is the files with the changes I had to made to overcome this bug :
--.emacs---
(semantic-mode 1)
(global-ede-mode 1)
(global-semantic-decoration-mode)
+ (require 'semantic/bovine/c)
(ede-cpp-root-project "tlh"
:name "tlh"
:file "/home/jonathlela/tlh/Makefile"
:system-include-path '( "/home/jonathlela/devkitPro/libnds/include" )
:spp-table '(
( "ARM9" . "1" )
( "ARM7" . "1" )
)
)
---cpp-root.el---
(defmethod ede-set-project-variables ((project ede-cpp-root-project) &optional buffer)
"Set variables local to PROJECT in BUFFER.
Also set up the lexical preprocessor map."
(call-next-method)
- (when (and (featurep 'semantic/c) (featurep 'semantic/lex-spp))
+ (when (and (featurep 'semantic/bovine/c) (featurep 'semantic/lex-spp))
(setq semantic-lex-spp-project-macro-symbol-obarray
(semantic-lex-make-spp-table (oref project spp-table)))
))
Nevertheless, The include files are still not parsed with the right #define. I
don't know yet if it's a bug or a PEBCAK. Have somenone successfully use
ede-cpp-root-project with the emacs23.2 build ?
Regards,
Jonathan Marchand
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#6231: 23.2; ede-cpp-root-projects spp table is not taken into account by semantic in cedet
2010-05-20 14:03 bug#6231: 23.2; ede-cpp-root-projects spp table is not taken into account by semantic in cedet Jonathan Marchand
@ 2010-05-24 11:53 ` Jonathan Marchand
2010-05-26 17:50 ` bug#6231: " Jonathan Marchand
1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Marchand @ 2010-05-24 11:53 UTC (permalink / raw)
To: 6231
[-- Attachment #1: Type: text/plain, Size: 861 bytes --]
Ok, I have found the other bug that prevents ede-cpp-root to use the
project preprocessor symbols.
In fact, the emacs23.2 version of cedet use the symbols defined in
:spp-table to parse the include files specified in :include, (with the
bugfix I gave earlier) but not for :system-include-path.
I was not sure it was a bug or a feature, but by checkouting the CVS
version of cedet, I could figure the intended behavior was to use the
symbols for both, so this is a bug.
The problem is the variable
semantic-lex-spp-project-macro-symbol-obarray which is correctly set
when parsing a file within the project, but set to nil when parsing an
external include. This time I couldn't figure where in the code the
problem is, so I can't report a way to solve this. I hope some people
from the dev team can fix this.
Regards,
Jonathan Marchand
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#6231: ede-cpp-root-projects spp table is not taken into account by semantic in cedet
2010-05-20 14:03 bug#6231: 23.2; ede-cpp-root-projects spp table is not taken into account by semantic in cedet Jonathan Marchand
2010-05-24 11:53 ` Jonathan Marchand
@ 2010-05-26 17:50 ` Jonathan Marchand
2010-05-31 20:31 ` Stefan Monnier
1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Marchand @ 2010-05-26 17:50 UTC (permalink / raw)
To: 6231
[-- Attachment #1.1: Type: text/plain, Size: 482 bytes --]
After some more striving to make it work, I find that the misfunction
was my deed for the second part. The only bug is what I've reported in
the first part, ie, the mis-translation from original cedet to the emacs
build one. I provide a awesome patch to fix this bug (I've firstly check
the bazaar rep to make it sure this was not already solved, but the bug
is still on).
Please fix this bug, so that people can finally use cedet with c-cpp
project.
Regards,
Jonathan Marchand
[-- Attachment #1.2: patch-cedet --]
[-- Type: text/plain, Size: 560 bytes --]
=== modified file 'lisp/cedet/ede/cpp-root.el'
--- lisp/cedet/ede/cpp-root.el 2010-01-16 02:51:50 +0000
+++ lisp/cedet/ede/cpp-root.el 2010-05-26 15:44:32 +0000
@@ -467,7 +467,7 @@
"Set variables local to PROJECT in BUFFER.
Also set up the lexical preprocessor map."
(call-next-method)
- (when (and (featurep 'semantic/c) (featurep 'semantic/lex-spp))
+ (when (and (featurep 'semantic/bovine/c) (featurep 'semantic/lex-spp))
(setq semantic-lex-spp-project-macro-symbol-obarray
(semantic-lex-make-spp-table (oref project spp-table)))
))
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#6231: ede-cpp-root-projects spp table is not taken into account by semantic in cedet
2010-05-26 17:50 ` bug#6231: " Jonathan Marchand
@ 2010-05-31 20:31 ` Stefan Monnier
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2010-05-31 20:31 UTC (permalink / raw)
To: Jonathan Marchand; +Cc: 6231
> After some more striving to make it work, I find that the misfunction
> was my deed for the second part. The only bug is what I've reported in
> the first part, ie, the mis-translation from original cedet to the emacs
> build one. I provide a awesome patch to fix this bug (I've firstly check
> the bazaar rep to make it sure this was not already solved, but the bug
> is still on).
> Please fix this bug, so that people can finally use cedet with c-cpp
> project.
I have just installed your patch in the emacs-23 branch.
Thank you very much for your contribution,
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-31 20:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 14:03 bug#6231: 23.2; ede-cpp-root-projects spp table is not taken into account by semantic in cedet Jonathan Marchand
2010-05-24 11:53 ` Jonathan Marchand
2010-05-26 17:50 ` bug#6231: " Jonathan Marchand
2010-05-31 20:31 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.