diff options
-rw-r--r-- | company-ebuild.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/company-ebuild.el b/company-ebuild.el index 30f564a..f67a63e 100644 --- a/company-ebuild.el +++ b/company-ebuild.el @@ -145,9 +145,11 @@ FILE-PATH is the location from which we start searching for repository root." "Return found Eclass files. REPO-ROOT is the location from which we start searching for Eclass files." - (and repo-root - (directory-files - (expand-file-name "eclass" repo-root) t ".*\\.eclass" t))) + (when repo-root + (let ((repo-eclass + (expand-file-name "eclass" repo-root))) + (when (file-exists-p repo-eclass) + (directory-files repo-eclass t ".*\\.eclass" t))))) (defun company-ebuild--regenerate-dynamic-keywords-eclass () "Set new content of the ‘company-ebuild--dynamic-keywords’ Eclass variables." @@ -199,8 +201,11 @@ REPO-ROOT is the location from which we start searching for Eclass files." (let ((repo-root (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)))))) + (let ((repo-licenses + (expand-file-name "licenses" repo-root))) + (when (file-exists-p repo-licenses) + (setq company-ebuild--dynamic-keywords-licenses + (directory-files repo-licenses))))))) (defun company-ebuild--regenerate-dynamic-keywords () "Regenerate dynamic keywords." |