m2ym/auto-complete — Issue #66: ac-trigger-key-command doesn't acutally trigger the completion
Author: vitoshka
Created: 2012-01-21 15:03:46+00:00
State: open

Hi Tomohiro,

Thanks for the great package.

One issue with the latest git head and emacs 23.3.1 on Ubuntu.

I have

(ac-set-trigger-key "TAB")

and this assignes 'ac-trigger-key-command to TAB but it doesn't trigger the completion.

I also have ac-auto-start 2.

From the source I see

(defun ac-trigger-key-command (&optional force)
(interactive "P")
(message "%s" last-command) ;; <- my addition
(if (or force (ac-trigger-command-p last-command))
(auto-complete)
(ac-fallback-command 'ac-trigger-key-command)))

last-command here is the one previous to ac-trigger-key-command and I am always
getting into ac-fallback-command no matter what.

This version works ok:

(defun ac-trigger-key-command (&optional force)
(interactive "P")
(if (or force
(eq this-command 'ac-trigger-key-command)
(ac-trigger-command-p last-command))
(auto-complete)
(ac-fallback-command 'ac-trigger-key-command)))

Thanks,
Vitalie.