1 |
commit: ca546788555cbd09b7540c34a550d445d96977b0 |
2 |
Author: Maciej Barć <xgqt <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 17 01:52:53 2022 +0000 |
4 |
Commit: Maciej Barć <xgqt <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 17 01:52:53 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/company-ebuild.git/commit/?id=ca546788 |
7 |
|
8 |
company-ebuild.el: add to local backends; add capf |
9 |
|
10 |
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org> |
11 |
|
12 |
company-ebuild.el | 15 +++++++++------ |
13 |
1 file changed, 9 insertions(+), 6 deletions(-) |
14 |
|
15 |
diff --git a/company-ebuild.el b/company-ebuild.el |
16 |
index b50900a..9c857e2 100644 |
17 |
--- a/company-ebuild.el |
18 |
+++ b/company-ebuild.el |
19 |
@@ -239,7 +239,6 @@ ARG is the completion argument for annotation and candidates." |
20 |
(annotation |
21 |
(car (company-ebuild--annotation-and-kind arg))) |
22 |
(candidates |
23 |
- ;; TODO: Complete any string that already appears in current buffer. |
24 |
(cl-remove-if-not (lambda (candidate) |
25 |
(string-prefix-p arg candidate t)) |
26 |
(append company-ebuild--constant-keywords |
27 |
@@ -269,11 +268,15 @@ or `require' Company-Ebuild: |
28 |
;; Regenerate dynamic keywords. |
29 |
(company-ebuild--regenerate-dynamic-keywords) |
30 |
;; Add the `company-ebuild' backend. |
31 |
- (cond |
32 |
- ((fboundp 'company-yasnippet) |
33 |
- (add-to-list 'company-backends '(company-ebuild company-yasnippet))) |
34 |
- (t |
35 |
- (add-to-list 'company-backends 'company-ebuild))) |
36 |
+ (setq-local company-backends |
37 |
+ `((company-ebuild |
38 |
+ company-capf ; standard fallback |
39 |
+ ,@(cond |
40 |
+ ((fboundp 'company-yasnippet) ; YAS for easier setup |
41 |
+ '(company-yasnippet)) |
42 |
+ (t |
43 |
+ '()))) |
44 |
+ ,@company-backends)) |
45 |
;; Because some completions have length 1: |
46 |
(setq-local company-minimum-prefix-length 1) |
47 |
(setq-local company-require-match nil)) |