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
|