summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--company-ebuild.el32
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."