]> code.delx.au - gnu-emacs-elpa/blobdiff - company-dabbrev.el
Removed superfluous quotes.
[gnu-emacs-elpa] / company-dabbrev.el
index 3d828a1c1a10f61751beb53b8ef6c7271c2b3a40..f4453e98c316e48b2ba4d5ef9ee6fc55d514efb0 100644 (file)
@@ -2,7 +2,7 @@
 ;;
 ;; Copyright (C) 2009 Nikolaj Schumacher
 ;;
-;; This file is part of company 0.3.1.
+;; This file is part of company 0.5.
 ;;
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License
@@ -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)
@@ -96,15 +104,15 @@ See also `company-dabbrev-time-limit'."
   "A dabbrev-like `company-mode' completion back-end."
   (interactive (list 'interactive))
   (case command
-    ('interactive (company-begin-backend 'company-dabbrev))
-    ('prefix (company-grab-word))
-    ('candidates
+    (interactive (company-begin-backend 'company-dabbrev))
+    (prefix (company-grab-word))
+    (candidates
      (mapcar 'downcase
              (company-dabbrev--search (company-dabbrev--make-regexp arg)
                                       company-dabbrev-time-limit
                                       company-dabbrev-other-buffers)))
-    ('ignore-case t)
-    ('duplicates t)))
+    (ignore-case t)
+    (duplicates t)))
 
 (provide 'company-dabbrev)
 ;;; company-dabbrev.el ends here