From 322ae5cabfecb244dc3c398395ad5dd1e58c5493 Mon Sep 17 00:00:00 2001 From: Maciej Barć Date: Fri, 26 Aug 2022 00:51:33 +0200 Subject: company-ebuild.el: fix regeneration of eclasses and licenses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maciej Barć --- company-ebuild.el | 15 ++++++++++----- 1 file 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." -- cgit v1.2.3-65-gdbad