fix(emacs/lean-mode): run company-lean--check-prefix before auto-complete

fix #191
This commit is contained in:
Soonho Kong 2014-09-14 23:07:17 -07:00
parent 27b20c5585
commit 1527efb108
2 changed files with 9 additions and 3 deletions

View file

@ -22,6 +22,12 @@
(setq-local company-begin-commands '(self-insert-command)) ; start autocompletion only after typing
(company-mode t))
(defun company-lean--check-prefix ()
"Check whether to use company-lean or not"
(or (company-lean--import-prefix)
(company-lean--findg-prefix)
(company-lean--findp-prefix)))
(defun company-lean--import-remove-lean (file-name)
(cond
((s-ends-with? "/default.lean" file-name)

View file

@ -67,9 +67,9 @@
(interactive)
(if (minibufferp)
(minibuffer-complete)
(cond (lean-company-use
(or (company-complete)
(eri-indent)))
(cond ((and lean-company-use (company-lean--check-prefix))
(company-complete-common))
(lean-company-use (eri-indent))
((lean-check-expansion)
(completion-at-point-functions))
(t (eri-indent)))))