emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 250ca1c 088/173: Add company-etags-everywhere


From: Dmitry Gutov
Subject: [elpa] master 250ca1c 088/173: Add company-etags-everywhere
Date: Thu, 23 Jun 2016 00:28:40 +0000 (UTC)

branch: master
commit 250ca1c395c6f05b733abce69a2d928b6cd31618
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Add company-etags-everywhere
    
    
https://github.com/redguardtoo/emacs.d/commit/2ff305c1ddd7faff6dc9fa0869e39f1e9ed1182d#commitcomment-14837584
---
 NEWS.md          |    1 +
 company-etags.el |   15 +++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 6e92cce..b3ab123 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* New user option `company-etags-everywhere`.
 * `company-yasnippet` supports `yas-key-syntaxes` better. But we use them in 
the
   reverse order, preferring the longest key prefix that matches anything. And 
we
   only consider trigger key prefixes that are at least as long as the symbol at
diff --git a/company-etags.el b/company-etags.el
index d1f6aaa..ef53213 100644
--- a/company-etags.el
+++ b/company-etags.el
@@ -45,6 +45,15 @@ buffer automatically."
   :type 'boolean
   :package-version '(company . "0.7.3"))
 
+(defcustom company-etags-everywhere nil
+  "Non-nil to offer completions in comments and strings.
+Set it to t or to a list of major modes."
+  :type '(choice (const :tag "Off" nil)
+                 (const :tag "Any supported mode" t)
+                 (repeat :tag "Some major modes"
+                         (symbol :tag "Major mode")))
+  :package-version '(company . "0.9.0"))
+
 (defvar company-etags-modes '(prog-mode c-mode objc-mode c++-mode java-mode
                               jde-mode pascal-mode perl-mode python-mode))
 
@@ -80,8 +89,10 @@ buffer automatically."
   (interactive (list 'interactive))
   (cl-case command
     (interactive (company-begin-backend 'company-etags))
-    (prefix (and (apply 'derived-mode-p company-etags-modes)
-                 (not (company-in-string-or-comment))
+    (prefix (and (apply #'derived-mode-p company-etags-modes)
+                 (or (eq t company-etags-everywhere)
+                     (apply #'derived-mode-p company-etags-everywhere)
+                     (not (company-in-string-or-comment)))
                  (company-etags-buffer-table)
                  (or (company-grab-symbol) 'stop)))
     (candidates (company-etags--candidates arg))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]