all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

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.