From 072d9f0797b40068aeb99f1c68eaeff72f26a34a Mon Sep 17 00:00:00 2001 From: Nikolaj Schumacher Date: Sat, 25 Apr 2009 09:11:33 +0200 Subject: [PATCH] Extracted company-semantic-modes variable. --- company-semantic.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/company-semantic.el b/company-semantic.el index 25b73f506..13b913344 100644 --- a/company-semantic.el +++ b/company-semantic.el @@ -26,6 +26,8 @@ :group 'company :type 'function) +(defvar company-semantic-modes '(c-mode c++-mode jde-mode java-mode)) + (defun company-semantic-doc-or-summary (tag) (or (semantic-documentation-for-tag tag) (funcall semantic-idle-summary-function tag nil t))) @@ -88,7 +90,7 @@ Symbols are chained by \".\" or \"->\"." (interactive (list 'interactive)) (case command ('interactive (company-begin-backend 'company-semantic)) - ('prefix (and (memq major-mode '(c-mode c++-mode jde-mode java-mode)) + ('prefix (and (memq major-mode company-semantic-modes) (semantic-active-p) (not (company-in-string-or-comment)) (or (company-semantic--grab) 'stop))) -- 2.39.2