Here’s a few suggestions:
-
(setq ac-auto-start t)
starts autocomplete automatically. If you change that to(setq ac-auto-start 1)
(or 2 or 3) then it will only start after that many characters have been typed. This might not solve your problem though if after you type the;
, it considers the entire preceding word as part of the current auto-complete search. -
Maybe the problem is that it isn’t recognizing the semicolon as a delimiting character (like whitespace), so it thinks you’re still adding to the last word. Perhaps adding the semicolon string to ac-ignores would do the trick? (Not sure what the syntax for that would be)
-
Maybe you can prevent auto-completion via the enter key by adding:
(define-key ac-complete-mode-map "\t" 'ac-complete)
and(define-key ac-complete-mode-map "\r" nil)
. I’m not sure how this will interact with DWIM though (enabled by default). -
Try adding semicolon as an auto-complete key?
My .emacs knowledge on a scale of 0 to 10 is like a 1.5, but maybe this will jog some better ideas.