]> code.delx.au - gnu-emacs-elpa/blobdiff - company-dabbrev.el
Make dabbrev and dabbrev-code more customizable
[gnu-emacs-elpa] / company-dabbrev.el
index 6d43ee47d8be467ff2666ec40bf28524157841d6..afe60f2a957c2cced6d062f4b6948548edcd9545 100644 (file)
 (require 'company)
 (eval-when-compile (require 'cl))
 
+(defgroup company-dabbrev nil
+  "dabbrev-like completion back-end."
+  :group 'company)
+
 (defcustom company-dabbrev-other-buffers 'all
   "Determines whether `company-dabbrev' should search other buffers.
 If `all', search all other buffers.  If t, search buffers with the same
 major mode.
 See also `company-dabbrev-time-limit'."
-  :group 'company
   :type '(choice (const :tag "Off" nil)
                  (const :tag "Same major mode" t)
                  (const :tag "All" all)))
 
 (defcustom company-dabbrev-time-limit .5
   "Determines how many seconds `company-dabbrev' should look for matches."
-  :group 'company
   :type '(choice (const :tag "Off" nil)
                  (number :tag "Seconds")))
 
 (defcustom company-dabbrev-char-regexp "\\sw"
   "A regular expression matching the characters `company-dabbrev' looks for."
-  :group 'company
   :type 'regexp)
 
+(defcustom company-dabbrev-ignore-case 'keep-prefix
+  "The value of `ignore-case' returned by `company-dabbrev'.")
+
 (defmacro company-dabrev--time-limit-while (test start limit &rest body)
   (declare (indent 3) (debug t))
   `(let ((company-time-limit-while-counter 0))
@@ -119,7 +123,7 @@ See also `company-dabbrev-time-limit'."
              (company-dabbrev--search (company-dabbrev--make-regexp arg)
                                       company-dabbrev-time-limit
                                       company-dabbrev-other-buffers)))
-    (ignore-case t)
+    (ignore-case company-dabbrev-ignore-case)
     (duplicates t)))
 
 (provide 'company-dabbrev)