[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 08/21: Add new option, company-dabbrev-minimum-length
From: |
Dmitry Gutov |
Subject: |
[elpa] 08/21: Add new option, company-dabbrev-minimum-length |
Date: |
Mon, 03 Feb 2014 17:36:16 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit 78f9165c546be534d37bcb640ff7f5999acee3b7
Author: Dmitry Gutov <address@hidden>
Date: Fri Jan 31 06:29:41 2014 +0200
Add new option, company-dabbrev-minimum-length
---
company-dabbrev.el | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/company-dabbrev.el b/company-dabbrev.el
index 6328e91..b9d47a3 100644
--- a/company-dabbrev.el
+++ b/company-dabbrev.el
@@ -53,6 +53,9 @@ See also `company-dabbrev-time-limit'."
(defcustom company-dabbrev-ignore-case 'keep-prefix
"The value of `ignore-case' returned by `company-dabbrev'.")
+(defcustom company-dabbrev-minimum-length (1+ company-minimum-prefix-length)
+ "The minimum length for the string to be included.")
+
(defmacro company-dabrev--time-limit-while (test start limit &rest body)
(declare (indent 3) (debug t))
`(let ((company-time-limit-while-counter 0))
@@ -82,7 +85,8 @@ See also `company-dabbrev-time-limit'."
(setq match (match-string-no-properties 0))
(if (and ignore-comments (company-in-string-or-comment))
(re-search-backward "\\s<\\|\\s!\\|\\s\"\\|\\s|" nil t)
- (push match symbols)))
+ (when (>= (length match) company-dabbrev-minimum-length)
+ (push match symbols))))
(goto-char (or pos (point-min)))
;; search after pos
(company-dabrev--time-limit-while (re-search-forward regexp nil t)
@@ -90,7 +94,8 @@ See also `company-dabbrev-time-limit'."
(setq match (match-string-no-properties 0))
(if (and ignore-comments (company-in-string-or-comment))
(re-search-forward "\\s>\\|\\s!\\|\\s\"" nil t)
- (push match symbols)))
+ (when (>= (length match) company-dabbrev-minimum-length)
+ (push match symbols))))
symbols)))
(defun company-dabbrev--search (regexp &optional limit other-buffers
- [elpa] branch master updated (6265448 -> 7d682e9), Dmitry Gutov, 2014/02/03
- [elpa] 05/21: company-sort-by-occurrence: handle cons prefixes, Dmitry Gutov, 2014/02/03
- [elpa] 03/21: Lower dabbrev time limits, Dmitry Gutov, 2014/02/03
- [elpa] 07/21: company-sort-by-occurrence: update the docstring, Dmitry Gutov, 2014/02/03
- [elpa] 09/21: company-transformers: improve the defcustom widget, Dmitry Gutov, 2014/02/03
- [elpa] 08/21: Add new option, company-dabbrev-minimum-length,
Dmitry Gutov <=
- [elpa] 10/21: Don't generate bogus event in Emacs 24.4, Dmitry Gutov, 2014/02/03
- [elpa] 06/21: Fix #54, Dmitry Gutov, 2014/02/03
- [elpa] 11/21: Render company-preview-frontend after the cursor, Dmitry Gutov, 2014/02/03
- [elpa] 12/21: company-preview* faces: inherit from company-tooltip-[common-]selection, Dmitry Gutov, 2014/02/03
- [elpa] 15/21: Remove NEWS entry for 9b0d457, it's a bugfix, Dmitry Gutov, 2014/02/03
- [elpa] 17/21: company-capf: strip duplicates, Dmitry Gutov, 2014/02/03
- [elpa] 01/21: company-begin-commands: add `org-self-insert-command', Dmitry Gutov, 2014/02/03
- [elpa] 21/21: Merge commit '67ab56a5469f16652e73667ec3b4f76ff6befee6' from company, Dmitry Gutov, 2014/02/03
- [elpa] 16/21: Don't "transform" twice, Dmitry Gutov, 2014/02/03
- [elpa] 20/21: Remove outdated comment, Dmitry Gutov, 2014/02/03