]> code.delx.au - gnu-emacs-elpa/commitdiff
New option company-etags-ignore-case
authorIngo Lohmar <i.lohmar@gmail.com>
Sun, 23 Mar 2014 10:25:59 +0000 (11:25 +0100)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 24 Mar 2014 06:35:16 +0000 (08:35 +0200)
When t, find tags candidates case-insensitively

company-etags.el

index 270e3a255673e5529ebd3dc3b64df3db4a08f8fa..437faad5e162c2b3402c248d172da49c5c7f928f 100644 (file)
@@ -40,6 +40,12 @@ buffer automatically."
   :type '(choice (const :tag "off" nil)
                  (const :tag "on" t)))
 
+(defcustom company-etags-ignore-case nil
+  "Ignore case for `company-etags'.  This implies that candidates are
+searched case-insensitively."
+  :type '(choice (const :tag "off" nil)
+                 (const :tag "on" t)))
+
 (defvar company-etags-modes '(prog-mode c-mode objc-mode c++-mode java-mode
                               jde-mode pascal-mode perl-mode python-mode))
 
@@ -61,7 +67,7 @@ buffer automatically."
 
 (defun company-etags--candidates (prefix)
   (let ((tags-table-list (company-etags-buffer-table))
-        (completion-ignore-case nil))
+        (completion-ignore-case company-etags-ignore-case))
     (and (or tags-file-name tags-table-list)
          (fboundp 'tags-completion-table)
          (save-excursion
@@ -83,7 +89,8 @@ buffer automatically."
                 (when (fboundp 'find-tag-noselect)
                   (save-excursion
                     (let ((buffer (find-tag-noselect arg)))
-                      (cons buffer (with-current-buffer buffer (point))))))))))
+                      (cons buffer (with-current-buffer buffer (point))))))))
+    (ignore-case company-etags-ignore-case)))
 
 (provide 'company-etags)
 ;;; company-etags.el ends here