GNU bug report logs - #6231
23.2; ede-cpp-root-projects spp table is not taken into account by semantic in cedet

Previous Next

Package: emacs;

Reported by: Jonathan Marchand <jonathlela <at> gmail.com>

Date: Thu, 20 May 2010 15:52:02 UTC

Severity: normal

Found in version 23.2

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6231 in the body.
You can then email your comments to 6231 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6231; Package emacs. (Thu, 20 May 2010 15:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Marchand <jonathlela <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 20 May 2010 15:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Marchand <jonathlela <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2; ede-cpp-root-projects spp table is not taken into account by
	semantic in cedet
Date: Thu, 20 May 2010 16:03:30 +0200
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6231; Package emacs. (Mon, 24 May 2010 11:52:01 GMT) Full text and rfc822 format available.

Message #8 received at 6231 <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Marchand <jonathlela <at> gmail.com>
To: 6231 <at> debbugs.gnu.org
Subject: 23.2; ede-cpp-root-projects spp table is not taken into account by
	semantic in cedet
Date: Mon, 24 May 2010 13:53:18 +0200
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6231; Package emacs. (Wed, 26 May 2010 17:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 6231 <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Marchand <jonathlela <at> gmail.com>
To: 6231 <at> debbugs.gnu.org
Subject: ede-cpp-root-projects spp table is not taken into account by
	semantic in cedet
Date: Wed, 26 May 2010 19:50:21 +0200
[Message part 1 (text/plain, inline)]
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
[patch-cedet (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6231; Package emacs. (Mon, 31 May 2010 20:32:02 GMT) Full text and rfc822 format available.

Message #14 received at 6231 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jonathan Marchand <jonathlela <at> gmail.com>
Cc: 6231 <at> debbugs.gnu.org
Subject: Re: bug#6231: ede-cpp-root-projects spp table is not taken into
	account by semantic in cedet
Date: Mon, 31 May 2010 16:31:19 -0400
> 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




bug closed, send any further explanations to Jonathan Marchand <jonathlela <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 14 Jun 2010 21:22:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 13 Jul 2010 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.