From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7E4DD158094 for ; Thu, 25 Aug 2022 23:00:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E9FF7E0843; Thu, 25 Aug 2022 23:00:32 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B7327E0828 for ; Thu, 25 Aug 2022 23:00:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8B41D3411CC for ; Thu, 25 Aug 2022 23:00:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DC0DF57D for ; Thu, 25 Aug 2022 23:00:29 +0000 (UTC) From: "Maciej Barć" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Maciej Barć" Message-ID: <1661467893.322ae5cabfecb244dc3c398395ad5dd1e58c5493.xgqt@gentoo> Subject: [gentoo-commits] proj/company-ebuild:master commit in: / X-VCS-Repository: proj/company-ebuild X-VCS-Files: company-ebuild.el X-VCS-Directories: / X-VCS-Committer: xgqt X-VCS-Committer-Name: Maciej Barć X-VCS-Revision: 322ae5cabfecb244dc3c398395ad5dd1e58c5493 X-VCS-Branch: master Date: Thu, 25 Aug 2022 23:00:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 6138beef-76a8-4e6b-8953-dc3ee55f09e5 X-Archives-Hash: 7398409b4385fd44b7003258ebea1d0e commit: 322ae5cabfecb244dc3c398395ad5dd1e58c5493 Author: Maciej Barć gentoo org> AuthorDate: Thu Aug 25 22:51:33 2022 +0000 Commit: Maciej Barć gentoo org> CommitDate: Thu Aug 25 22:51:33 2022 +0000 URL: https://gitweb.gentoo.org/proj/company-ebuild.git/commit/?id=322ae5ca company-ebuild.el: fix regeneration of eclasses and licenses Signed-off-by: Maciej Barć gentoo.org> 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."