"Eric M. Ludlam" <eric@...> writes:
> On Tue, 2009-08-25 at 23:35 +0200, zwz wrote:
>> I use semantic for completion. Here are something that I found
>> annoying:
>>
>> - I add senator-try-expand-semantic into hippie-expand-try-functions-list. But
> I
>> found that when there are multiple completion candidates, [tab] does not
>> change the completion to the next candidate, which is not consistent to the
>> other functions in hippie-expand-try-functions-list, like try-expand-dabbrev
> etc.
>
> I haven't examined this feature since Emacs 21. I wonder if the hippie
> expand APIs had changed?
>
>> - I copied some elisp from the web that binds "." to (call-interactively
>> 'semantic-complete-self-insert), which is quite convenient for c++
>> programming. However, I found that when you press "." and you press other
>> chars immediately (before the candidates list pops up), the cursor and all the
>> inputs will go to some other place. This bothers me a lot. I checked the
>> comment in the source code of semantic-complete-self-insert. It seems that
>> this case is specifically handled, but I have no idea why the cursor moves.
>
> The smart completion engine fires up all sorts of code that moves the
> cursor around examining different files or code blocks. What does
> surprise me also is that the input goes to those locations. I suspect
> that I was too patient when I was working on those features.
>
> I was not able to replicate the problem using a simple example. I'll
> guess that there is a missing `save-excursion' somewhere. Can you
> provide clues as to the locations where the stray text is going?
Yes, here is an example.
void PolyContour::test()
{
int i = 0;
PolyContour c;
c/*CURSOR*/
}
where /*CURSOR*/ stands for the cursor. Now it is on the last line of
the function definition. Then I type . and another char (e.g. x)
quickly, the cursor goes to void/*CURSOR*/ at the first time. And I move
it back to the last line, and try several times. It can go to
PolyContour/*CURSOR*/, test/*CURSOR*/ and the line before the function.
> Thanks
> Eric
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
|