12
votes

since I can't get CEDET to work for automatic code-completion (aka intelli-sense in the MS-world), after trying several times (no, it's just not working!), I've decided to use auto-complete, which works "quite fine" for me.

Unfortunately, auto-complete has an annoying behaviour when it comes to quit the imenu with its suggestions.

  1. auto-complete starts imenu, no matter how many suggestions it has. So, if there's only one suggestion, the menu appears. 1.
  2. To exit the imenu, I have to use the LEFT or RIGHT keys in order to make the menu disappear. ESC-ESC-ESC does not have any effect.

Is there any way, to modify these two behaviors?

Here's an excerpt of my .emacs file showing the auto-complete relevant stuff:

(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)
(setq ac-delay 0.5) ;; eclipse uses 500ms

Kind regards, mefiX

1

1 Answers

5
votes

'Stop autocompleting' can be set by adding the following to your .emacs:

(define-key ac-completing-map "\ESC/" 'ac-stop)

...or alternatively you can use C-g as the default Emacs StopSomething command :)

As for showing the completion in a menu when there's only one candidate, I'm not really sure what other behaviour you'd want?