diff options
author | 2022-08-17 03:52:53 +0200 | |
---|---|---|
committer | 2022-08-17 03:52:53 +0200 | |
commit | ca546788555cbd09b7540c34a550d445d96977b0 (patch) | |
tree | 730dff1cf844a72ab25b5e67db220496993bcff4 | |
parent | Cask: add (diff) | |
download | company-ebuild-ca546788555cbd09b7540c34a550d445d96977b0.tar.gz company-ebuild-ca546788555cbd09b7540c34a550d445d96977b0.tar.bz2 company-ebuild-ca546788555cbd09b7540c34a550d445d96977b0.zip |
company-ebuild.el: add to local backends; add capf
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
-rw-r--r-- | company-ebuild.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/company-ebuild.el b/company-ebuild.el index b50900a..9c857e2 100644 --- a/company-ebuild.el +++ b/company-ebuild.el @@ -239,7 +239,6 @@ ARG is the completion argument for annotation and candidates." (annotation (car (company-ebuild--annotation-and-kind arg))) (candidates - ;; TODO: Complete any string that already appears in current buffer. (cl-remove-if-not (lambda (candidate) (string-prefix-p arg candidate t)) (append company-ebuild--constant-keywords @@ -269,11 +268,15 @@ or `require' Company-Ebuild: ;; Regenerate dynamic keywords. (company-ebuild--regenerate-dynamic-keywords) ;; Add the `company-ebuild' backend. - (cond - ((fboundp 'company-yasnippet) - (add-to-list 'company-backends '(company-ebuild company-yasnippet))) - (t - (add-to-list 'company-backends 'company-ebuild))) + (setq-local company-backends + `((company-ebuild + company-capf ; standard fallback + ,@(cond + ((fboundp 'company-yasnippet) ; YAS for easier setup + '(company-yasnippet)) + (t + '()))) + ,@company-backends)) ;; Because some completions have length 1: (setq-local company-minimum-prefix-length 1) (setq-local company-require-match nil)) |