1 |
commit: 322ae5cabfecb244dc3c398395ad5dd1e58c5493 |
2 |
Author: Maciej Barć <xgqt <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 25 22:51:33 2022 +0000 |
4 |
Commit: Maciej Barć <xgqt <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 25 22:51:33 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/company-ebuild.git/commit/?id=322ae5ca |
7 |
|
8 |
company-ebuild.el: fix regeneration of eclasses and licenses |
9 |
|
10 |
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org> |
11 |
|
12 |
company-ebuild.el | 15 ++++++++++----- |
13 |
1 file changed, 10 insertions(+), 5 deletions(-) |
14 |
|
15 |
diff --git a/company-ebuild.el b/company-ebuild.el |
16 |
index 30f564a..f67a63e 100644 |
17 |
--- a/company-ebuild.el |
18 |
+++ b/company-ebuild.el |
19 |
@@ -145,9 +145,11 @@ FILE-PATH is the location from which we start searching for repository root." |
20 |
"Return found Eclass files. |
21 |
|
22 |
REPO-ROOT is the location from which we start searching for Eclass files." |
23 |
- (and repo-root |
24 |
- (directory-files |
25 |
- (expand-file-name "eclass" repo-root) t ".*\\.eclass" t))) |
26 |
+ (when repo-root |
27 |
+ (let ((repo-eclass |
28 |
+ (expand-file-name "eclass" repo-root))) |
29 |
+ (when (file-exists-p repo-eclass) |
30 |
+ (directory-files repo-eclass t ".*\\.eclass" t))))) |
31 |
|
32 |
(defun company-ebuild--regenerate-dynamic-keywords-eclass () |
33 |
"Set new content of the ‘company-ebuild--dynamic-keywords’ Eclass variables." |
34 |
@@ -199,8 +201,11 @@ REPO-ROOT is the location from which we start searching for Eclass files." |
35 |
(let ((repo-root |
36 |
(company-ebuild--find-repo-root buffer-file-name))) |
37 |
(when repo-root |
38 |
- (setq company-ebuild--dynamic-keywords-licenses |
39 |
- (directory-files (expand-file-name "licenses" repo-root)))))) |
40 |
+ (let ((repo-licenses |
41 |
+ (expand-file-name "licenses" repo-root))) |
42 |
+ (when (file-exists-p repo-licenses) |
43 |
+ (setq company-ebuild--dynamic-keywords-licenses |
44 |
+ (directory-files repo-licenses))))))) |
45 |
|
46 |
(defun company-ebuild--regenerate-dynamic-keywords () |
47 |
"Regenerate dynamic keywords." |