3

I am using auto-complete-mode with ac-c-headers and whenever I type std:: There is a long (~30 seconds) pause, presumably while the candidates list is populated. This happens every time, which suggests that there is no caching to speed things up for the next time.

Is there a way to avoid the pause after every time I type std::?

Update

Using the emacs profiler, I have now discovered that the pretty much all of the time is being spent in the functions semantic-analyze-possible-completions and semantic-analyze-current-context. This suggests that the real problem probably lies with semantic. I have also learned that including anything from the Boost libraries causes a significant increase in the amount of time required for semantic to return possible completions.

(In case it makes a difference, I am using Emacs 24.5 on Linux)

  • I don't use auto-complete-mode, but 30 seconds is really long! If you don't get an answer here, consider contacting the package maintainer -- 30 sec is long enough to suspect a bug. You might also try debugging it, with M-x debug-on-entry for the function that performs the completion. – Drew Oct 16 '15 at 5:51
  • You're not on Windows or Cygwin are you? – nanny Oct 21 '15 at 18:44
  • @nanny: no, this is on RHEL. – nispio Oct 21 '15 at 20:17
  • Are you satisfied with disabling semantic-mode and only leave auto-complete-mode on? – phonycollectibles Jan 15 '17 at 21:46
  • Same problem here. Have you solved the issue in the meanwhile ? – user52366 May 23 at 12:15
1

I've hit this same problem before and I "solved" it by changing the value of ac-delay from 0.1s to 1.0, like so:

(set-variable 'ac-delay 1.0)

That means that as I'm typing it only attempts the auto-complete if I stop typing for a second. So if you know you want a std::vector you can just keep typing and auto-complete never fires.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.