summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--company-ebuild.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/company-ebuild.el b/company-ebuild.el
index ef4096b..b50900a 100644
--- a/company-ebuild.el
+++ b/company-ebuild.el
@@ -218,6 +218,14 @@ FILE-PATH is the location from which we start searching for Eclass files."
(company-ebuild--regenerate-dynamic-keywords-packages)
(company-ebuild--regenerate-dynamic-keywords-licenses))
+(defun company-ebuild--grab-symbol ()
+ "Workaround wrapper for `company-grab-symbol'."
+ ;; TODO: (Hard mode) write a proper `company-grab-symbol' replacement.
+ (with-syntax-table (copy-syntax-table (syntax-table))
+ (modify-syntax-entry ?/ "w")
+ (modify-syntax-entry ?@ "w") ; To make Eclass tags work.
+ (company-grab-symbol)))
+
;;;###autoload
(defun company-ebuild (command &optional arg &rest ignored)
@@ -242,7 +250,7 @@ ARG is the completion argument for annotation and candidates."
(kind
(cdr (company-ebuild--annotation-and-kind arg)))
(prefix
- (and (eq major-mode 'ebuild-mode) (company-grab-symbol)))
+ (and (eq major-mode 'ebuild-mode) (company-ebuild--grab-symbol)))
(require-match
nil)))
@@ -255,10 +263,6 @@ in your config:
\(add-hook 'ebuild-mode-hook 'company-ebuild-setup)
or `require' Company-Ebuild:
\(require 'company-ebuild)"
- ;; HACK: Modify syntax to treat "/" as a word constituent.
- ;; TODO: (Hard mode) write a proper `company-grab-symbol' replacement.
- (modify-syntax-entry ?/ "w")
- (modify-syntax-entry ?@ "w") ; To make Eclass tags work.
;; Force-enable `company-mode'.
(when (null company-mode)
(company-mode +1))