summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'company-ebuild.el')
-rw-r--r--company-ebuild.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/company-ebuild.el b/company-ebuild.el
index e2c34df..022a058 100644
--- a/company-ebuild.el
+++ b/company-ebuild.el
@@ -139,7 +139,9 @@ For example:
"Return the root directory of current Ebuild repository.
FILE-PATH is the location from which we start searching for repository root."
- (locate-dominating-file file-path "profiles/repo_name"))
+ (and (not (null file-path))
+ (file-exists-p file-path)
+ (locate-dominating-file file-path "profiles/repo_name")))
(defun company-ebuild--find-eclass-files (file-path)
"Return found Eclass files.
@@ -154,8 +156,7 @@ FILE-PATH is the location from which we start searching for Eclass files."
(defun company-ebuild--regenerate-dynamic-keywords-eclasses ()
"Set new content of the ‘company-ebuild--dynamic-keywords’ Eclass variables."
(let ((repo-root
- (and buffer-file-name
- (company-ebuild--find-repo-root buffer-file-name))))
+ (company-ebuild--find-repo-root buffer-file-name)))
(when repo-root
(let ((eclass-files
(company-ebuild--find-eclass-files repo-root)))
@@ -182,8 +183,7 @@ FILE-PATH is the location from which we start searching for Eclass files."
(defun company-ebuild--regenerate-dynamic-keywords-use-flags ()
"Set new content of the ‘company-ebuild--dynamic-keywords-use-flags’ variable."
(let ((repo-root
- (and buffer-file-name
- (company-ebuild--find-repo-root buffer-file-name)))
+ (company-ebuild--find-repo-root buffer-file-name))
(awk-format
"awk -F - '{ print $1 }' %s/profiles/use.desc"))
(when (and repo-root
@@ -207,8 +207,7 @@ FILE-PATH is the location from which we start searching for Eclass files."
(defun company-ebuild--regenerate-dynamic-keywords-licenses ()
"Set new content of the ‘company-ebuild--dynamic-keywords-licenses’ variable."
(let ((repo-root
- (and buffer-file-name
- (company-ebuild--find-repo-root buffer-file-name))))
+ (company-ebuild--find-repo-root buffer-file-name)))
(when repo-root
(setq company-ebuild--dynamic-keywords-licenses
(directory-files (expand-file-name "licenses" repo-root))))))