]> code.delx.au - gnu-emacs-elpa/commitdiff
Added company-dabbrev-char-regexp.
authorNikolaj Schumacher <git@nschum.de>
Fri, 17 Apr 2009 08:40:24 +0000 (10:40 +0200)
committerNikolaj Schumacher <git@nschum.de>
Sat, 18 Apr 2009 11:00:17 +0000 (13:00 +0200)
company-dabbrev.el

index 3d828a1c1a10f61751beb53b8ef6c7271c2b3a40..212a430034396893f9fd9a53ab60d0a9843e9206 100644 (file)
@@ -36,6 +36,11 @@ See also `company-dabbrev-time-limit'."
   :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)
+
 (defmacro company-dabrev--time-limit-while (test start limit &rest body)
   (declare (indent 3) (debug t))
   `(let ((company-time-limit-while-counter 0))
@@ -49,7 +54,10 @@ See also `company-dabbrev-time-limit'."
               (throw 'done 'company-time-out))))))
 
 (defsubst company-dabbrev--make-regexp (prefix)
-  (concat "\\<" (if (equal prefix "") "\\sw" (regexp-quote prefix)) "\\sw*\\>"))
+  (concat "\\<" (if (equal prefix "")
+              company-dabbrev-char-regexp
+            (regexp-quote prefix))
+          "\\(" company-dabbrev-char-regexp "\\)*\\>"))
 
 (defun company-dabbrev--search-buffer (regexp pos symbols start limit
                                        ignore-comments)