diff options
author | 2022-08-17 17:12:54 +0200 | |
---|---|---|
committer | 2022-08-17 17:16:45 +0200 | |
commit | 1eae6f34f926d4983b660bc0fe111e293b94718c (patch) | |
tree | 5e4527e63fa13bb02cc69023880e68d70a735f6e | |
parent | company-ebuild.el: company-ebuild--find-eclass-files - remove redundant check (diff) | |
download | company-ebuild-1eae6f34f926d4983b660bc0fe111e293b94718c.tar.gz company-ebuild-1eae6f34f926d4983b660bc0fe111e293b94718c.tar.bz2 company-ebuild-1eae6f34f926d4983b660bc0fe111e293b94718c.zip |
company-ebuild.el: company-ebuild--regenerate-dynamic-keywords-eclasses - add-to-list
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
-rw-r--r-- | company-ebuild.el | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/company-ebuild.el b/company-ebuild.el index 7a1b51a..15224af 100644 --- a/company-ebuild.el +++ b/company-ebuild.el @@ -157,25 +157,19 @@ REPO-ROOT is the location from which we start searching for Eclass files." (when repo-root (let ((eclass-files (company-ebuild--find-eclass-files repo-root))) - (setq company-ebuild--dynamic-keywords-eclasses - (apply #'append - (mapcar (lambda (f) - (mapcar (lambda (s) - (replace-regexp-in-string "\\.eclass" - "" - s)) - (company-ebuild--get-tags f "ECLASS"))) - eclass-files))) - (setq company-ebuild--dynamic-keywords-variables - (apply #'append - (mapcar (lambda (f) - (company-ebuild--get-tags f "ECLASS_VARIABLE")) - eclass-files))) - (setq company-ebuild--dynamic-keywords-functions - (apply #'append - (mapcar (lambda (f) - (company-ebuild--get-tags f "FUNCTION")) - eclass-files))))))) + (mapc + (lambda (eclass-file) + (mapc (lambda (str) + (add-to-list 'company-ebuild--dynamic-keywords-eclasses + (replace-regexp-in-string "\\.eclass" "" str))) + (company-ebuild--get-tags eclass-file "ECLASS")) + (mapc (lambda (str) + (add-to-list 'company-ebuild--dynamic-keywords-variables str)) + (company-ebuild--get-tags eclass-file "ECLASS_VARIABLE")) + (mapc (lambda (str) + (add-to-list 'company-ebuild--dynamic-keywords-functions str)) + (company-ebuild--get-tags eclass-file "FUNCTION"))) + eclass-files))))) (defun company-ebuild--regenerate-dynamic-keywords-use-flags () "Set new content of the ‘company-ebuild--dynamic-keywords-use-flags’ variable." |