On Tuesday 05 October 2004 13:25, you wrote:
> >>> axa <axa@...> seems to think that:
> >Although I'm new in using Emacs generally, I know the basics and intend to
> > use "Semantic" mainly in C/C++ programming. Basically. what I'm trying to
> > do, is to make Emacs (semantic) show struct/class members (it is not
> > necessary to autocomplete its member names, but only to show information
> > about them) and function/method information (its argument list or
> > prototype signature). I've installed CEDET, and after a few modifications
> > in ~/.emacs I've (partially) made it show some of above mentioned
> > information, that is, it can show some informations about structs/classes
> > and/or functions/methods, but only for some structs/classes and functions
> > that are defined outside of some namespace (std for exmaple).
> >Attempt to get information about variable that was declared as stl
> > "string", fails, but although "string" is typedef of "basic_string" it
> > also fails when variable is declared as "basic_string" instance.
> >However if I put the defintion of "basic_string" class/functions outside
> > its "stl" namespace, and declare variable as its instance, "semantic"
> > shows proper information about its members.
> There are still issues with namespaces and dereferencing objects.
> At the moment, using statements are not known to semantic. This is a
> feature that needs to be implemented since other languages use that
> feature too.
Thank you for responding Eric. Does this feature works at all, for C/C++ or is
that still compeletell unimplemented?
> You can probably get a feel for how things are being interpreted by
> using the command "M-x semantic-analyze-current-context RET" to see
> what it thinks.
For simple test program, it only shows local information about local (in file)
> >Also, "semantic" doesn't show function argument list (or protype
> > signature) for some C functions (it only shows information about
> > functions that are defined/declared in the same file that's being edited)
> > . For example, when "stdio.h" is included, typing "printf" reports (in
> > minibuffer): Update Tag Table: main, and when there is opened bracket
> > after its name like "printf(" it reports: Buffer not currently parsable.
> > Guessing that the first message means that there should be some "tags"
> > file loaded, I've tried to make tags file for printf (`etags
> > --declarations /usr/include/stdio.h`) and then load it, but with no
> > result, moreover I couldn't even find printf tag in newly created TAG
> > file, so I've recreated tag file but now for "stdlib.h" and tried to get
> > prototype showed for strtol, atoi... again with no result, although now
> > there are tags for these functions (but still it seems that there are no
> > tags for every function).
> Etags tables are not used by semantic. To get stuff from a system
> header file, you will need to use the command:
> M-x semanticdb-create-system-database
> and point it at /usr/include, or wherever.
> In theory, this should set things up for those declarations.
I've tried this, with whole "/usr/include" directory, unfortunately this makes
no difference, it still doesn't show neither C function prototypes (for
example, printf, strlen, time...) or system C functions (write, clone,
> It has been a long time since I wrote that, so I don't remember much
> more. I need to revisit that so I can write some documentation.
> >~/.emacs file looks like the following:
> > (setq-default transient-mark-mode t)
> > (setq-default case-fold-search t)
> > (setq c-default-style
> > '((c-mode . "stroustrup") (c++-mode . "stroustrup")
> >(other . "gnu")))
> > (setq c-indent-level 3)
> > (setq c-tab-always-indent nil)
> > (global-font-lock-mode t)
> > (setq font-lock-maximum-decoration
> > '((c-mode . 2) (c++-mode . 2)))
> > ;;(setq tags-table-list
> > ;; '("~/TAGS"))
> > (setq semantic-load-turn-useful-things-on t)
> > ;; Load CEDET
> > (load-file
> >el") (setq semanticdb-project-roots
> > (list "/usr/include/c++/3.3.4"
> > "~/prog"))
> This is almost the right idea here. ~/prog is important as the root
> of a single project. Adding /usr/include/c++ only helps if you are
> editing a file under /usr/include/c++. The roots are used as a
> baseline for a given file you may be editing. All roots are not
> included in a search, only the root for the current file.
> > ;; prog is a test directory
> > (require 'eldoc)
> > (autoload 'turn-on-eldoc-mode "eldoc" nil t)
> >Can you please tell how can it be made to show information about
> >structs/classes and functions/methods from all included files (in C/C++)
> > in file being edited, whether they are defined within some namespace
> > (std), as "typedef" (string), macro or extern (printf)?
> [ ... ]
> There is only a subset of C++ parsing and reverse referencing
> available right not. More needs to be done for C++ specific
> customizations. If you are interesting in hacking some Emacs Lisp,
> let me know and I'll get you some pointers.
Unfortunately I don't program in (E)Lisp.