>Hi everybody,
>I am using semantic 1.4.3. The following C++ code appears underlined:
>class list_of_facts : public list<fact>, public entity {
>};
>g++ compiles it ok (of course).
>Is it a bug in the parser?
Yes...seems that currently no templates are recognized as parents...
I will look into the parser when i find time...maybe this weekend...
Ciao,
Klaus

ECB 1.93 is released!
What's new in the new release:
------------------------------
* Changes for ECB version 1.93
** Fixed bugs:
*** The adviced version of `other-window' now works correct too if a
minibuffer-window is active.
*** The commands of `winner-mode' are now only forbidden in the ECB-frame
but work in any other frame.
*** `scroll-all-mode' now works correct in other frames than the ECB-frame.
*** Removed the annoying message "Partial reparsing..."
** Enhancements to the layout:
*** Slightly better redrawing current layout especially if the layout contains
a compile-window.
*** ECB autom. displays hidden compile-window before starting a compilation.
This is done if `ecb-compile-window-height' is not nil but the
compile-window is currently hidden by `ecb-toggle-compile-window'. Of
course this works also for grep and other compile-modes. Same for
`switch-to-buffer' and `switch-to-buffer-other-window' if called for a
compilation-buffer in the sense of `ecb-compilation-buffer-p'.
*** `switch-to-buffer-other-window' now works more naturally within the
ECB-frame, especially if a compile-window is used.
*** `ecb-toggle-compile-window' now has a default key-binding: [C-c . \]
*** Now also layouts with user-defined special ecb-windows can be created
interactively. See the online-manual for further details.
** Enhancements to the tree-buffers:
*** Now user-extensions can be added to the popup-menues of the tree-buffers.
See new options `ecb-directories-menu-user-extension',
`ecb-sources-menu-user-extension', `ecb-methods-menu-user-extension',
`ecb-history-menu-user-extension'.
*** The methods-buffer now has a popup-menu with senseful actions
** New option `ecb-sources-exclude-cvsignore' which allows to exclude files from
being displayed in the sources-buffer if they are contained in a .cvsignore
file.
** ECB now also works with buffers "online" extracted from archives.
Buffers extracted from an archive in `tar-mode' or `archive-mode' are now
correct handled as if they were normal file-buffers. This feature doesn't
work with XEmacs cause of its tar-mode and arc-mode implementation which
does not handle extracted files as normal files.
** ECB now checks at load-time if the required packages semantic and eieio are
at least available - regardless of the needed version. If at least one of
these packages is missing then ECB offers to download and install it. More
details are available in the installation instructions.
How to get it:
--------------
Sorry, it's too big to post the sources here...
If you are using ECB >= 1.80 then you can just call "M-x ecb-download-ecb" if
you are online. ECB will then download autom. latest and newest ECB and
install it for you.
Or go to the homepage at <http://ecb.sourceforge.net&gt; http://ecb.sourceforge.net and download it from
there.
General description of ECB:
---------------------------
*ECB* is a source code browser for Emacs. It is a global minor-mode which
displays a couple of special windows that can be used to browse directories,
files and file-contents like methods and variables. It is based on the tool
*semantic* and supports source-code parsing for Java, C, C++, Elisp, Scheme
etc.
Here is an ascii-screenshot of what ECB offers you:
------------------------------------------------------------------
| | |
| Directories | |
| | |
|--------------| |
| | |
| Sources | |
| | |
|--------------| Edit-window(s) |
| | (can be splitted in two windows) |
| Methods/Vars | |
| | |
|--------------| |
| | |
| History | |
| | |
------------------------------------------------------------------
| |
| Compilation-window (optional) |
| |
------------------------------------------------------------------
This is only one example-layout - ECB offers a lot of different layouts.
For more details go to <http://ecb.sourceforge.net/&gt; http://ecb.sourceforge.net/
Enjoy,
Klaus
Klaus Berndl mailto: <mailto:klaus.berndl@...> klaus.berndl@...
sd&m AG <http://www.sdm.de/&gt; http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220

On Wednesday 26 March 2003 20:07, Eric M. Ludlam wrote:
> >I have some issues I'd like to point to your attention:
> >
> >- I noticed that semantic-analyze-possible-completions was not
> > available with M-x until I called M-x speedbar. Is that normal?
>
> Probably a missing auto-load. If you (require 'semantic-analyze) you
> will get it.
I did it, and it works! Great.
> You might want to try one of the commands in semantic-ia.el instead
> which act more like M-TAB.
Yes! I put
(require 'semantic-ia)
into my .emacs and now those commands are available. I mean,
semantic-ia-complete-symbol.
(PS: May I suggest you to add that to the instructions in the INSTALL
file:
(require 'semantic-ia)
(require 'semantic-analyze)
)
This is not so obvious for newbies like me.
Anyway, I noticed that semantic-ia-complete-symbol does not always
complete: it stops to the first ambiguity.
e.g.
struct cc{
int my_1;
int my_2;
};
void ff(){
cc c;
c.m //here
}
if you call semantic-ia-complete-symbol on the line with //here, it
completes c.my_
i.e. it stops to the next ambiguity.
SO I suppose the canonical way would be to call
semantic-analyze-possible-completions now?
So it's a 3-way process:
1. call semantic-ia-complete-symbol
if there is an ambiguity:
2. call semantic-analyze-possible-completions
3. decide the desired completion and type it
It sounds a bit too complicated, if compared to Vstudio.
Suggested fix: if there is an ambiguity, semantic-ia-complete-symbol
automatically calls semantic-analyze-possible-completions.
This way, selection of the identifier name becomes a two-way process:
1. call semantic-ia-complete-symbol
if there is an ambiguity:
2. decide the desired completion and type it
Of course this simplifies my life, but maybe it breaks someone else's
needs. What do you think?
> >- If I write the first letter of a member variable (say 'r'), e.g.
> >
> > my_struct m;
> > m.r
> >
> > and then call semantic-analyze-possible-completions, the completions
> > do appear (starting with the letter r), but the cursor is moved
> > before r, thus forcing me to write C-e to go to the end of the line
> > (and then write the rest of the name).
>
> Sounds like a bug. Try the commands in semantic-ia instead.
Great, it works, except for the problem of ambiguities explaied above.
> >- IMHO Semantic would be better if it allowed you to move inside the
> > completion buffer with C-n C-p, and to select the completion you
> > want (e.g. by pressing ENTER). i.e. so far it only lists the
> > possible completions, but once you've chosen one, you must type it
> > by hand.
>
> Yep. The command you are using is a debugging tool.
I don't quite understand your point. You don't think that feature to
be useful?
IMHO, this would save lots of typing and would persuade MANY visual
studio addicts to pass to emacs.
> >- char my_char;
> > ....
> > my_char = 'a';
> >
> > When I place the cursor on the second occurrence of my_char, its
> > type is not displayed on the minibuffer. It would be nice to know
> > the type of a variable without finding its declaration.
>
> The eldoc functionality only works with declarations outside the body
> of a function.
Oh, I see. that's not a big deal, but are you planning to make it work
with local variables also?
> >- why does M-x bovinate not leave the focus (cursor) in the current
> > window? It seems I must call bovinate very often, and each time I
> > must do C-x o to get back... this is unpractical.
>
> It is a debugging tool. I think you can use M-- M-x bovinate to
> avoid that.
Ok, anyway it seems I don't need to call bovinate, since reparsing is
done in the background.
> >- When I type a function call, the arguments correctly appear in the
> > minibuffer, but the current argument is not highlighted. e.g. if I
> > have written
> >
> > f(3,4,
> >
> > I would like the third argument in the minibuffer to be more
> > evident, maybe bold.
>
> That's a clever idea. It is a balance between speed and functionality.
I'm glad you think so... but then, why the other one wasn't? (I mean,
the dropdown list with possible completions, a-la Visual Studio)
> >Let me be sure I've got it. IN order to have completion of the members
> >of stl::vector and stl::string I must do
> >
> >(setq semanticdb-project-roots
> > (list "/usr/include/c++/3.2/"))
> >
> >in my .emacs?
>
> Yes. You also need to have semanticdb parse those files.
by calling semanticdb-save-all-db?
Eric, considering you can use semantic for any language, Microsoft
should really be scared of how semantic is growing...
But: why is it not part of standard Emacs?
bye (and sorry for the question bombing)
Maurizio

Ok, now it works, but has a behavior I don't understand: when I open
(visit) the file, some lines are underlined by default.
e.g.
template <class c> class temp{
public:
typedef int iter;
};
class temp2{
list<temp<int> >::const_iterator t; // this is underlined
};
only when I modify the line or the class (e.g. by inserting a dummy
space), semantic reparses the class and removes the underlining.
Is that normal?

>>> Klaus Berndl <klaus.berndl@...> seems to think that:
>On Wed, 26 Mar 2003, Eric M. Ludlam wrote:
[ ... ]
>> It is usually set up if you followed the INSTALL file. Some folks
>> turn it off because they don't like the semantic.cache files that are
>> created.
>
>I don't like these cache files too but nevertheless i have turned on semanticdb
>because it is really an important tool.
>
>Just do something like this in your .emacs and Bob is your uncle:
>
>(setq semanticdb-default-save-directory "~/.semantic.caches")
>
>Now you can use semanticdb but you do not have these annoying cache-files in
>every directory.
>
>Eric, what do you think...IMHO semanticdb-default-save-directory should have a
>default-value like mine?!
I wonder about that. I'm annoyed when applications put large files
in ~/.something because it slurps up precious disk space, and I
don't see them. Since the semantic cache files are so large I'm a
little worried about "hiding" them someplace a novice would be unable
to find them.
>Maybe a lot of users are not aware of this option ....
[ ... ]
That is certainly true. Some people install the JDE, then complain
about the cache files because there isn't a jde option for it.
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org

On Wed, 26 Mar 2003, Eric M. Ludlam wrote:
> >>> Jan Sacharuk <jan@...> seems to think that:
> >On Wed, 26 Mar 2003 13:53:20 -0500, Eric M. Ludlam <eric@...>
> >wrote:
> >
> >
> >> Hi,
> >> The `bovinate' command is only needed iff you disable
> >> semantic-auto-reparse-mode and make a `big' change to a file. (Like
> >> adding a new function.) Auto reparse mode schedules full reparses
> >> of a buffer in idle time.
> >
> >Ah, okay. I'm fairly sure my auto reparsing is on, since ECB seems to be
> >able to update its buffers just fine. Or is that a different system all
> >together?
>
> ECB uses semantic for its displays.
>
> >> Also, if you need completion from classes in other files you need
> >> semanticdb enabled. Once enabled, you just need to visit the files
> >> you care about once to have them made searchable.
> >
> >I definitely have that set up.
>
> It is usually set up if you followed the INSTALL file. Some folks
> turn it off because they don't like the semantic.cache files that are
> created.
I don't like these cache files too but nevertheless i have turned on semanticdb
because it is really an important tool.
Just do something like this in your .emacs and Bob is your uncle:
(setq semanticdb-default-save-directory "~/.semantic.caches")
Now you can use semanticdb but you do not have these annoying cache-files in
every directory.
Eric, what do you think...IMHO semanticdb-default-save-directory should have a
default-value like mine?!
Maybe a lot of users are not aware of this option ....
Ciao,
Klaus
>
> Have fun
> Eric
--
Klaus Berndl mailto: klaus.berndl@...
sd&m AG http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220

>>> Jan Sacharuk <jan@...> seems to think that:
>On Wed, 26 Mar 2003 13:53:20 -0500, Eric M. Ludlam <eric@...>
>wrote:
>
>
>> Hi,
>> The `bovinate' command is only needed iff you disable
>> semantic-auto-reparse-mode and make a `big' change to a file. (Like
>> adding a new function.) Auto reparse mode schedules full reparses
>> of a buffer in idle time.
>
>Ah, okay. I'm fairly sure my auto reparsing is on, since ECB seems to be
>able to update its buffers just fine. Or is that a different system all
>together?
ECB uses semantic for its displays.
>> Also, if you need completion from classes in other files you need
>> semanticdb enabled. Once enabled, you just need to visit the files
>> you care about once to have them made searchable.
>
>I definitely have that set up.
It is usually set up if you followed the INSTALL file. Some folks
turn it off because they don't like the semantic.cache files that are
created.
Have fun
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org

>>> Jan Sacharuk <jan@...> seems to think that:
>Since I've upgraded to Semantic 1.4.3, it's much slower opening files than
>it used to be. It spends a lot of time doing something that reads as 'Imenu
>Directory Index'. What's going on there? My emacs startup time went from
>about 25 seconds to well over a minute, since I have emacs reopen all the
>files that I was working on when I quit.
You probably want to set the variable `semantic-imenu-index-directory'
to nil. For large directories, that will make things go faster.
>As well, Semantic deals poorly with source files that have a lot of #ifdefs
>in them that may hide or add braces. I have a source file that has several
>#ifdefs and it refuses to parse it or format it correctly, since it thinks
>that there are unbalanced braces.
[ ... ]
Yup. There isn't a very good way to deal with a pre-processor in
semantic yet. As a special case "#if 0" blocks are removed. You can
build lexical extensions for your most common false ifdefs to strip them
out, but it requires some knowledge of Emacs Lisp.
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org

Since I've upgraded to Semantic 1.4.3, it's much slower opening files than
it used to be. It spends a lot of time doing something that reads as 'Imenu
Directory Index'. What's going on there? My emacs startup time went from
about 25 seconds to well over a minute, since I have emacs reopen all the
files that I was working on when I quit.
As well, Semantic deals poorly with source files that have a lot of #ifdefs
in them that may hide or add braces. I have a source file that has several
#ifdefs and it refuses to parse it or format it correctly, since it thinks
that there are unbalanced braces.
Thanks,
JS
--
Jan Sacharuk
Programmer
BioWare Corp.
jan@...

On Wed, 26 Mar 2003 13:53:20 -0500, Eric M. Ludlam <eric@...>
wrote:
> Hi,
> The `bovinate' command is only needed iff you disable
> semantic-auto-reparse-mode and make a `big' change to a file. (Like
> adding a new function.) Auto reparse mode schedules full reparses
> of a buffer in idle time.
Ah, okay. I'm fairly sure my auto reparsing is on, since ECB seems to be
able to update its buffers just fine. Or is that a different system all
together?
> Also, if you need completion from classes in other files you need
> semanticdb enabled. Once enabled, you just need to visit the files
> you care about once to have them made searchable.
I definitely have that set up.
> The automatic display engine for the analyzer is only available in
> speedbar. You can, however, embed speedbar in ECB and do both.
Fair enough. I didn't realize that.
Thanks. Working with Visual Studio is such a chore, but it's undoubtably
useful to have the intellisense behaviour working. :)
JS
--
Jan Sacharuk
Programmer
BioWare Corp.
jan@...

>>> Maurizio Colucci <seguso@...> seems to think that:
>Hello,
>
>> Now that I've been reading this thread, I have some questions too, since
>> I've been trying to get this behaviour working for a few months now.
>>
>> >> In order for the context analyzer to work, the struct must be
>> >> complete (you need a semi-colon at the end)
>> >
>> > Oh, sorry for the typo. Anyway I was writing by heart... the real code
>> > that I tried did have the semicolon.
>> > Maybe it's that I was not calling bovinate.
>>
>> Does bovinate have to be called on every single file that I want
>> information pulled from? I've got several hundred source files that I'm
>> working with, so doing such a step would be incredibly time consuming. (I'd
>> probably be willing to do it, though.)
>>
>> >> Next, there is an existing bug where you need at least one
>> >> character after the . or -> before the local context parser will
>> >> work.
>> >
>> > That doesn't seem to be true... if I only write
>> >
>> > my_struct m;
>> > m.
>> >
>> > it displays all the members, which seems correct.
>>
>> I can't get that behaviour to occur at all! Nor can I get a list of
>> possible completions to come up automatically if I type one character after
>> the '.' or '->'.
>
>When you told me, I did another test and I couldn't reproduce the
>result. But I was sure that it had worked before: I had "just did it"!
>So I got angry and found the reason.
>
[ ... ]
>
>int main (){
> asshole george;
> george.
> int useless_dummy_instruction; // here
>}
>
>Put again the cursor after
> george.
>and try again.
>
>It works!
>
>So, as far as I understand, it is a bug, and I was lucky to have an
>instruction after the dot the first time I tried it.
>
>It feels like it could be useful, so forgive me if I post this to the
>list also.
[ ... ]
Thanks for the bit of research. That is useful to know. The attached
patch is for what is in CVS, but it should be possible to apply it to
semantic 1.4 as the analyzer hasn't changed much yet.
Eric
-------
*** semantic-analyze.el.~1.10.~ Sat Mar 8 11:24:45 2003
--- semantic-analyze.el Wed Mar 26 15:21:50 2003
***************
*** 417,423 ****
(bounds (save-excursion
(cond ((and prefix (looking-at endsym))
(cons (point) (progn
! (forward-sexp 1)
(point))))
(prefix
(condition-case nil
--- 417,425 ----
(bounds (save-excursion
(cond ((and prefix (looking-at endsym))
(cons (point) (progn
! (condition-case nil
! (forward-sexp 1)
! (error nil))
(point))))
(prefix
(condition-case nil
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org

>>> Maurizio Colucci <seguso@...> seems to think that:
[ ... ]
>> Once you fix that, you can use "M-x bovinate" to force the system
>> to synchronize your new file.
>
>That's it! I was looking for a function to reparse the file, and I
>couldn't find one (I only looked among the functions starting with
>"semantic-").
>
>So let me be sure I've got it: there is NO parsing done in the
>background? i.e. any time I change a prototype I must manually call
>bovinate? Never mind, I'll set up a shortcut.
You need to enable `global-semantic-auto-parse-mode' for reparsing in
the background. Also, there are two types of reparses. Partial
reparse happens whenever you use a semantic command. Full reprases
happen less often.
>>
>> Next, there is an existing bug where you need at least one
>> character after the . or -> before the local context parser will
>> work.
>>
>
>That doesn't seem to be true... if I only write
>
> my_struct m;
> m.
>
>it displays all the members, which seems correct.
Heh. It is a fickle beast.
>I have some issues I'd like to point to your attention:
>
>- I noticed that semantic-analyze-possible-completions was not
> available with M-x until I called M-x speedbar. Is that normal?
Probably a missing auto-load. If you (require 'semantic-analyze) you
will get it. You might want to try one of the commands in
semantic-ia.el instead which act more like M-TAB.
>- If I write the first letter of a member variable (say 'r'), e.g.
>
> my_struct m;
> m.r
>
> and then call semantic-analyze-possible-completions, the completions
> do appear (starting with the letter r), but the cursor is moved
> before r, thus forcing me to write C-e to go to the end of the line
> (and then write the rest of the name).
Sounds like a bug. Try the commands in semantic-ia instead.
>- IMHO Semantic would be better if it allowed you to move inside the
> completion buffer with C-n C-p, and to select the completion you
> want (e.g. by pressing ENTER). i.e. so far it only lists the
> possible completions, but once you've chosen one, you must type it
> by hand.
Yep. The command you are using is a debugging tool.
>- char my_char;
> ....
> my_char = 'a';
>
> When I place the cursor on the second occurrence of my_char, its
> type is not displayed on the minibuffer. It would be nice to know
> the type of a variable without finding its declaration.
The eldoc functionality only works with declarations outside the body
of a function.
>- why does M-x bovinate not leave the focus (cursor) in the current
> window? It seems I must call bovinate very often, and each time I
> must do C-x o to get back... this is unpractical.
It is a debugging tool. I think you can use M-- M-x bovinate to
avoid that.
>- When I type a function call, the arguments correctly appear in the
> minibuffer, but the current argument is not highlighted. e.g. if I
> have written
>
> f(3,4,
>
> I would like the third argument in the minibuffer to be more
> evident, maybe bold.
That's a clever idea. It is a balance between speed and functionality.
>These problems make me feel I am using semantic in a way it was not
>supposed to be used (e.g as if it were Microsoft's Visual Studio, or
>WholeTomato's Visual Assist under Windows).
>
>Are you aware of these problems and planning to fix them?
The analysis mode in semantic is a first cut at that type of
behavior. It showed many weaknesses in the existing parser
infrastructure. We are currently working on the infrastructure.
Once that has improved parsing and search features I can focus again
on improving he analyer.
>> [ ... ]
>>
>> >2) In case Semantic can display possible completions: how does it
>> >choose them? I mean, I should only see the public members if I'm
>> >outside of the class; also the private ones if I'm inside; the
>> >protected members if I am inside a derived class, and so on...
>> >And what about static members, which should only be available in a static
>> >member function?
>>
>> Right now the analyzer only works inside a function,
>
>I can't see a problem with it... provided you mean "member functions"
>also.
the analyzer just tests to see if you are in a function, so the
parser needs to see it first. Doesn't matter if it is a member
function, a function, or some other thing the parser marks as a
function.
>> and as I mentioned above, only after you have typed in at least one
>> character.
>>
>> In addition, it will only find completions in your project. It
>> will not find completions from system files unless you add them to
>> the project.
>
>Let me be sure I've got it. IN order to have completion of the members
>of stl::vector and stl::string I must do
>
>(setq semanticdb-project-roots
> (list "/usr/include/c++/3.2/"))
>
>in my .emacs?
Yes. You also need to have semanticdb parse those files.
>> Lastly, it will not find completions in files you have not visited
>> at least once with Emacs.
>
>No big deal. So I must manually visit "vector" and "string".
>Are you planning to fix that?;
The next version has a scripts to build a system database.
Have fun
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org

>>> Jan Sacharuk <jan@...> seems to think that:
[ ... ]
>>> In order for the context analyzer to work, the struct must be
>>> complete (you need a semi-colon at the end)
>>
>> Oh, sorry for the typo. Anyway I was writing by heart... the real code
>> that I tried did have the semicolon.
>> Maybe it's that I was not calling bovinate.
>
>Does bovinate have to be called on every single file that I want
>information pulled from? I've got several hundred source files that I'm
>working with, so doing such a step would be incredibly time consuming. (I'd
>probably be willing to do it, though.)
Hi,
The `bovinate' command is only needed iff you disable
semantic-auto-reparse-mode and make a `big' change to a file. (Like
adding a new function.) Auto reparse mode schedules full reparses
of a buffer in idle time.
Also, if you need completion from classes in other files you need
semanticdb enabled. Once enabled, you just need to visit the files
you care about once to have them made searchable.
The next version of semantic will have shell scripts to do that for you.
>>> Next, there is an existing bug where you need at least one
>>> character after the . or -> before the local context parser will
>>> work.
>>>
>>
>> That doesn't seem to be true... if I only write
>>
>> my_struct m;
>> m.
>>
>> it displays all the members, which seems correct.
>
>I can't get that behaviour to occur at all! Nor can I get a list of
>possible completions to come up automatically if I type one character after
>the '.' or '->'.
>
>I'm following the instructions laid out on the Semantic hompage, and I just
>installed 1.4.3. I'm still using Speedbar 1.4.
There are three ways to get a list of completions. One is via the
speedbar mode, and the other is to call
`semantic-analyze-possible-completions' which is sort of a debugging
routine, and the third is to use `semantic-ia-complete-symbol' command.
>Now, firstly, is it absolutely necessary to be using Speedbar? I prefer to
>do my work in ECB alone, so I've stopped using speedbar all together,
>basically. The step on the instruction page says that I have to do a
>'semantic-speedbar-analysis' to get a list of possible completions. While
>it's true that doing that causes speedbar to sit and think for a while, the
>list of possible completions are all entirely incorrect. Not a single
>member of my class appears, while a host of other completions that start
>with the same letter come up.
The automatic display engine for the analyzer is only available in
speedbar. You can, however, embed speedbar in ECB and do both.
>Up until now, I've been using the senator methods in ECB to do completions
>('senator-complete-symbol' and 'senator-completion-menu-popup'), but those
>seem to have little intelligence or awareness of class members.
>
>> - why does M-x bovinate not leave the focus (cursor) in the current
>> window? It seems I must call bovinate very often, and each time I
>> must do C-x o to get back... this is unpractical.
>
>I agree, especially since it brings up my ECB compile window.
It shouldn't be necessary to call bovinate alot. The auto-reparse
engine should do it for you. It may be there is a need to force a
reparse whenever the completion engine is run. You can also type:
"M-- M-x bovinate" to avoid the extra buffer.
>>> Lastly, it will not find completions in files you have not visited
>>> at least once with Emacs.
>
>Ah, this seems to answer my previous question somewhat, though I think that
>it's coming up with completions from files that I've never visited. Either
>that, or it's analysing things oddly. One of the main completions I get for
>members that start with 'm' is 'math3d.h'.
[ ... ]
Oh dear. I'll have to look into that.
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org

Hello,
> Now that I've been reading this thread, I have some questions too, since
> I've been trying to get this behaviour working for a few months now.
>
> >> In order for the context analyzer to work, the struct must be
> >> complete (you need a semi-colon at the end)
> >
> > Oh, sorry for the typo. Anyway I was writing by heart... the real code
> > that I tried did have the semicolon.
> > Maybe it's that I was not calling bovinate.
>
> Does bovinate have to be called on every single file that I want
> information pulled from? I've got several hundred source files that I'm
> working with, so doing such a step would be incredibly time consuming. (I'd
> probably be willing to do it, though.)
>
> >> Next, there is an existing bug where you need at least one
> >> character after the . or -> before the local context parser will
> >> work.
> >
> > That doesn't seem to be true... if I only write
> >
> > my_struct m;
> > m.
> >
> > it displays all the members, which seems correct.
>
> I can't get that behaviour to occur at all! Nor can I get a list of
> possible completions to come up automatically if I type one character after
> the '.' or '->'.
When you told me, I did another test and I couldn't reproduce the
result. But I was sure that it had worked before: I had "just did it"!
So I got angry and found the reason.
Make a file, call it test.cc and fill it with the following
statements:
struct asshole{
int height;
int name;
int name2;
int run(int time){}
};
int main (){
asshole george;
george.
}
Now place the cursor after the dot, i.e. after the word "george."
Do M-x semantic-analyze-possible-completions
You get an error. Right?
Now insert a dummy instruction after that line:
struct asshole{
int height;
int name;
int name2;
int run(int time){}
};
int main (){
asshole george;
george.
int useless_dummy_instruction; // here
}
Put again the cursor after
george.
and try again.
It works!
So, as far as I understand, it is a bug, and I was lucky to have an
instruction after the dot the first time I tried it.
It feels like it could be useful, so forgive me if I post this to the
list also.
> Now, firstly, is it absolutely necessary to be using Speedbar? I prefer to
> do my work in ECB alone, so I've stopped using speedbar all together,
> basically. The step on the instruction page says that I have to do a
> 'semantic-speedbar-analysis' to get a list of possible completions.
Well, I never heard of that (I have been using semantic for 10 minutes
only), but anyway it seems we just got a list of completion by calling
semantic-analyze-possible-completions.
I hope this helped...
cheers
Maurizio

On Wed, 26 Mar 2003 09:52:54 +0100, Maurizio Colucci <seguso@...>
wrote:
> Eric, thanks for you precious help.
> I still have some questions... :-P
Now that I've been reading this thread, I have some questions too, since
I've been trying to get this behaviour working for a few months now.
>> In order for the context analyzer to work, the struct must be
>> complete (you need a semi-colon at the end)
>
> Oh, sorry for the typo. Anyway I was writing by heart... the real code
> that I tried did have the semicolon.
> Maybe it's that I was not calling bovinate.
Does bovinate have to be called on every single file that I want
information pulled from? I've got several hundred source files that I'm
working with, so doing such a step would be incredibly time consuming. (I'd
probably be willing to do it, though.)
>> Next, there is an existing bug where you need at least one
>> character after the . or -> before the local context parser will
>> work.
>>
>
> That doesn't seem to be true... if I only write
>
> my_struct m;
> m.
>
> it displays all the members, which seems correct.
I can't get that behaviour to occur at all! Nor can I get a list of
possible completions to come up automatically if I type one character after
the '.' or '->'.
I'm following the instructions laid out on the Semantic hompage, and I just
installed 1.4.3. I'm still using Speedbar 1.4.
Now, firstly, is it absolutely necessary to be using Speedbar? I prefer to
do my work in ECB alone, so I've stopped using speedbar all together,
basically. The step on the instruction page says that I have to do a
'semantic-speedbar-analysis' to get a list of possible completions. While
it's true that doing that causes speedbar to sit and think for a while, the
list of possible completions are all entirely incorrect. Not a single
member of my class appears, while a host of other completions that start
with the same letter come up.
Up until now, I've been using the senator methods in ECB to do completions
('senator-complete-symbol' and 'senator-completion-menu-popup'), but those
seem to have little intelligence or awareness of class members.
> - why does M-x bovinate not leave the focus (cursor) in the current
> window? It seems I must call bovinate very often, and each time I
> must do C-x o to get back... this is unpractical.
I agree, especially since it brings up my ECB compile window.
>> Lastly, it will not find completions in files you have not visited
>> at least once with Emacs.
Ah, this seems to answer my previous question somewhat, though I think that
it's coming up with completions from files that I've never visited. Either
that, or it's analysing things oddly. One of the main completions I get for
members that start with 'm' is 'math3d.h'.
JS
--
Jan Sacharuk
Programmer
BioWare Corp.
jan@...

A quick question about installation of Semantic (and related packages...)
There don't seem to be good instructions for installation under a Windows
system. I'm forced to use Emacs on WinXP, and I'd like to be able to byte
compile all the files without doing each manually. Doing a batch operation
seems to fail because things aren't being done in the correct order. Is
there a list of ordering that is available, or some trick that I'm missing?
JS
--
Jan Sacharuk
Programmer
BioWare Corp.
jan@...

Eric, thanks for you precious help.
I still have some questions... :-P
> In order for the context analyzer to work, the struct must be
> complete (you need a semi-colon at the end)
Oh, sorry for the typo. Anyway I was writing by heart... the real code
that I tried did have the semicolon.
Maybe it's that I was not calling bovinate.
> and the function must also be parenthetically correct at least once
> during a parse phase.
So I must fist write the skeleton of the function whose code I'm
writing, complete with curly braces {}, and then write inside it? Good
to know! No big deal.
> Once you fix that, you can use "M-x bovinate" to force the system
> to synchronize your new file.
That's it! I was looking for a function to reparse the file, and I
couldn't find one (I only looked among the functions starting with
"semantic-").
So let me be sure I've got it: there is NO parsing done in the
background? i.e. any time I change a prototype I must manually call
bovinate? Never mind, I'll set up a shortcut.
>
> Next, there is an existing bug where you need at least one
> character after the . or -> before the local context parser will
> work.
>
That doesn't seem to be true... if I only write
my_struct m;
m.
it displays all the members, which seems correct.
I have some issues I'd like to point to your attention:
- I noticed that semantic-analyze-possible-completions was not
available with M-x until I called M-x speedbar. Is that normal?
- If I write the first letter of a member variable (say 'r'), e.g.
my_struct m;
m.r
and then call semantic-analyze-possible-completions, the completions
do appear (starting with the letter r), but the cursor is moved
before r, thus forcing me to write C-e to go to the end of the line
(and then write the rest of the name).
- IMHO Semantic would be better if it allowed you to move inside the
completion buffer with C-n C-p, and to select the completion you
want (e.g. by pressing ENTER). i.e. so far it only lists the
possible completions, but once you've chosen one, you must type it
by hand.
- char my_char;
....
my_char = 'a';
When I place the cursor on the second occurrence of my_char, its
type is not displayed on the minibuffer. It would be nice to know
the type of a variable without finding its declaration.
- why does M-x bovinate not leave the focus (cursor) in the current
window? It seems I must call bovinate very often, and each time I
must do C-x o to get back... this is unpractical.
- When I type a function call, the arguments correctly appear in the
minibuffer, but the current argument is not highlighted. e.g. if I
have written
f(3,4,
I would like the third argument in the minibuffer to be more
evident, maybe bold.
These problems make me feel I am using semantic in a way it was not
supposed to be used (e.g as if it were Microsoft's Visual Studio, or
WholeTomato's Visual Assist under Windows).
Are you aware of these problems and planning to fix them?
> [ ... ]
>
> >2) In case Semantic can display possible completions: how does it
> >choose them? I mean, I should only see the public members if I'm
> >outside of the class; also the private ones if I'm inside; the
> >protected members if I am inside a derived class, and so on...
> >And what about static members, which should only be available in a static
> >member function?
>
> Right now the analyzer only works inside a function,
I can't see a problem with it... provided you mean "member functions"
also.
> and as I mentioned above, only after you have typed in at least one
> character.
>
> In addition, it will only find completions in your project. It
> will not find completions from system files unless you add them to
> the project.
Let me be sure I've got it. IN order to have completion of the members
of stl::vector and stl::string I must do
(setq semanticdb-project-roots
(list "/usr/include/c++/3.2/"))
in my .emacs?
> Lastly, it will not find completions in files you have not visited
> at least once with Emacs.
No big deal. So I must manually visit "vector" and "string".
Are you planning to fix that?;
> There are also some other cases where completions might not be
> found related to parent classes, and namespaces. Right now the
> completion engine is not language specific, and does not yet have
> many extension mechanisms.
Ok.
Thanks again,
ciao
Maurizio

>>> Maurizio Colucci <seguso@...> seems to think that:
>Hello,
>
>I am just starting with semantic bovinator... Basically, I'm trying
>to have some more assistance when I write c++ code with emacs 21.
>
>I am fruitlessly trying to have automatic completion. The problem is I
>can't quite understand what semantic can and cannot do about
>intellisense.
>
>Could you please answer the following questions? It should be quick.
>
>1) When I type the name of a struct or class or namespace, and press
>the dot (.) or the arrow (->) or ::, I'd like a pop-up list to show
>the possible completions (i.e. member functions, member variables,
>constants...). Can semantic do that?
>
>I tried to write the following:
>
>struct c{
> int long_name;
>}
>
>int function(){
>
> c my_c;
> my_c.
>
Hi,
In order for the context analyzer to work, the struct must be
complete (you need a semi-colon at the end) and the function must
also be parenthetically correct at least once during a parse phase.
Once you fix that, you can use "M-x bovinate" to force the system
to synchronize your new file.
Next, there is an existing bug where you need at least one
character after the . or -> before the local context parser will
work.
[ ... ]
>2) In case Semantic can display possible completions: how does it
>choose them? I mean, I should only see the public members if I'm
>outside of the class; also the private ones if I'm inside; the
>protected members if I am inside a derived class, and so on...
>And what about static members, which should only be available in a static
>member function?
Right now the analyzer only works inside a function, and as I
mentioned above, only after you have typed in at least one
character.
In addition, it will only find completions in your project. It
will not find completions from system files unless you add them to
the project. Lastly, it will not find completions in files you
have not visited at least once with Emacs.
There are also some other cases where completions might not be
found related to parent classes, and namespaces. Right now the
completion engine is not language specific, and does not yet have
many extension mechanisms.
>Thanks a lot to any kind soul :-)
>
>PS:
>I have installed semantic, speedbar and eieio (via the rpms supplied
>in http://cedet.sourceforge.net/intellisense.shtml).
>
[ ... ]
There is a newer version of semantic available in source form which
has many C++ parser improvements that may prove useful to you.
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org

Hello,
I am just starting with semantic bovinator... Basically, I'm trying
to have some more assistance when I write c++ code with emacs 21.
I am fruitlessly trying to have automatic completion. The problem is I
can't quite understand what semantic can and cannot do about
intellisense.
Could you please answer the following questions? It should be quick.
1) When I type the name of a struct or class or namespace, and press
the dot (.) or the arrow (->) or ::, I'd like a pop-up list to show
the possible completions (i.e. member functions, member variables,
constants...). Can semantic do that?
I tried to write the following:
struct c{
int long_name;
}
int function(){
c my_c;
my_c.
but nothing shows up, neither on the speedbar nor in the message line.
I tried to invoke M-x semantic-analyze-possible-completions, but it
returns an error:
"no context of type function to advance in".
I also tried to type the first letters of a member, and to repeat the
call to semantic-analyze-possible-completions, but I get the same
error (and I can't figure out what it means).
2) In case Semantic can display possible completions: how does it
choose them? I mean, I should only see the public members if I'm
outside of the class; also the private ones if I'm inside; the
protected members if I am inside a derived class, and so on...
And what about static members, which should only be available in a static
member function?
Thanks a lot to any kind soul :-)
PS:
I have installed semantic, speedbar and eieio (via the rpms supplied
in http://cedet.sourceforge.net/intellisense.shtml).
As the above doc required, I have added the following lines to my
.emacs:
(setq semantic-load-turn-useful-things-on t)
(require 'semantic-load)
(setq semanticdb-project-roots
(list "~/src/mind/src"))
Now the speedbar shows the .h and .cc files, and the minibuffer shows
some info about the type of the variable under cursor. But nothing
more.
-----------
Maurizio Colucci

>>> Dan Debertin <airboss@...> seems to think that:
>Is there a way to turn off the frobs that semantic adds to Imenu? I'd
>like to get Imenu back to a) only displaying one file's worth of tokens,
>and b) only displaying defuns/functions/methods, not types, variables,
>etc. In short, the old, pre-semantic imenu. None of the semantic-imenu
>customize knobs seem to do what I want.
>
>I'm doing:
>
>(setq semantic-load-turn-everything-on t)
>(require 'semantic-load)
[ ... ]
If you look in the "Senator" menu, you will see an "imenu config"
item, and the one you want to turn off is "list other files" whose
variable is `semantic-imenu-index-directory'. You can also turn off
binning within a file with the imenu config menu entry "bin tokens by
type" or the variable `semantic-imenu-bucketize-file'. There are
many `semantic-imenu-*' variables you can use to tweak how that menu
looks. If the menu doesn't change right away, you may need to use
the command "M-x bovinate RET" to give it a kick.
Good Luck
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org

Community

Help

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details