Skip to content

Commit

Permalink
Fix ac-fallback-command for special keys #109
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomohiro Matsuyama committed Sep 3, 2012
1 parent 88101a8 commit 2dbabec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions auto-complete.el
Expand Up @@ -1587,10 +1587,16 @@ that have been made before in this function."
(string-match "self-insert-command" (symbol-name command))
(string-match "electric" (symbol-name command)))))

(defun ac-fallback-key-sequence ()
(setq unread-command-events
(append (this-single-command-raw-keys)
unread-command-events))
(read-key-sequence-vector ""))

(defun ac-fallback-command (&optional except-command)
(let* ((auto-complete-mode nil)
(keys (this-command-keys-vector))
(command (if keys (key-binding keys))))
(keys (ac-fallback-key-sequence))
(command (and keys (key-binding keys))))
(when (and (commandp command)
(not (eq command except-command)))
(setq this-command command)
Expand Down

0 comments on commit 2dbabec

Please sign in to comment.