feat(emacs): add company mode (via etags)

This commit is contained in:
Soonho Kong 2014-08-18 16:10:07 -07:00
parent f0d50e0d33
commit c27a379f28
2 changed files with 13 additions and 3 deletions

View file

@ -52,7 +52,7 @@
(local-set-key "\C-c\C-t" 'lean-eldoc-documentation-function) (local-set-key "\C-c\C-t" 'lean-eldoc-documentation-function)
(local-set-key "\C-c\C-f" 'lean-fill-placeholder) (local-set-key "\C-c\C-f" 'lean-fill-placeholder)
(local-set-key "\M-." 'lean-find-tag) (local-set-key "\M-." 'lean-find-tag)
(local-set-key [tab] 'lean-complete-tag)) (local-set-key [tab] 'completion-at-point))
(define-abbrev-table 'lean-abbrev-table (define-abbrev-table 'lean-abbrev-table
'(("var" "variable") '(("var" "variable")
@ -92,7 +92,12 @@
(remove-hook 'lean-mode-hook 'whitespace-cleanup-mode)) (remove-hook 'lean-mode-hook 'whitespace-cleanup-mode))
;; eldoc ;; eldoc
(set (make-local-variable 'eldoc-documentation-function) (set (make-local-variable 'eldoc-documentation-function)
'lean-eldoc-documentation-function)) 'lean-eldoc-documentation-function)
;; company-mode
(when lean-company-use
(require 'company)
(company-mode t)
(set (make-local-variable 'company-backends) '(company-etags))))
;; Automatically use lean-mode for .lean files. ;; Automatically use lean-mode for .lean files.
;;;###autoload ;;;###autoload

View file

@ -35,6 +35,11 @@
:group 'lean :group 'lean
:type 'boolean) :type 'boolean)
(defcustom lean-company-use t
"Use company mode for lean."
:group 'lean
:type 'boolean)
(defcustom lean-flycheck-checker-name "lmake" (defcustom lean-flycheck-checker-name "lmake"
"lean-flychecker checker name" "lean-flychecker checker name"
:group 'lean :group 'lean