[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 06/14: Introduce company-dabbrev-downcase
From: |
Dmitry Gutov |
Subject: |
[elpa] 06/14: Introduce company-dabbrev-downcase |
Date: |
Tue, 18 Feb 2014 05:51:01 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit 902176176cd4b88a5f00a1b452e237acea64aa78
Author: Dmitry Gutov <address@hidden>
Date: Tue Feb 11 03:48:28 2014 +0200
Introduce company-dabbrev-downcase
Closes #60
---
company-dabbrev.el | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/company-dabbrev.el b/company-dabbrev.el
index b9d47a3..c0cd0e0 100644
--- a/company-dabbrev.el
+++ b/company-dabbrev.el
@@ -53,6 +53,16 @@ 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-downcase 'case-replace
+ "Whether to downcase the returned candidates.
+
+The value of nil means keep them as-is.
+`case-replace' means use the value of `case-replace'.
+Any other value means downcase.
+
+If you set this value to nil, you may also want to set
+`company-dabbrev-ignore-case' to any value other than `keep-prefix'.")
+
(defcustom company-dabbrev-minimum-length (1+ company-minimum-prefix-length)
"The minimum length for the string to be included.")
@@ -124,10 +134,15 @@ See also `company-dabbrev-time-limit'."
(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)))
+ (let ((words (company-dabbrev--search (company-dabbrev--make-regexp arg)
+ company-dabbrev-time-limit
+ company-dabbrev-other-buffers))
+ (downcase-p (if (eq company-dabbrev-downcase 'case-replace)
+ case-replace
+ company-dabbrev-downcase)))
+ (if downcase-p
+ (mapcar 'downcase words)
+ words)))
(ignore-case company-dabbrev-ignore-case)
(duplicates t)))
- [elpa] branch master updated (2e6b4f6 -> cae1efc), Dmitry Gutov, 2014/02/18
- [elpa] 04/14: Fix scrolling up from the last item, Dmitry Gutov, 2014/02/18
- [elpa] 06/14: Introduce company-dabbrev-downcase,
Dmitry Gutov <=
- [elpa] 01/14: Set company-added-newline to t if the buffer was modified, Dmitry Gutov, 2014/02/18
- [elpa] 02/14: Don't `company-cancel' twice, Dmitry Gutov, 2014/02/18
- [elpa] 05/14: Fix out-of-bounds error on truncated anno fontification, Dmitry Gutov, 2014/02/18
- [elpa] 07/14: company-capf: fix when company-point is nil, Dmitry Gutov, 2014/02/18
- [elpa] 03/14: New user option, company-continue-commands, Dmitry Gutov, 2014/02/18
- [elpa] 08/14: company--capf-data: Check that the cdr is cons, not data itself, Dmitry Gutov, 2014/02/18
- [elpa] 09/14: company-capf common-part: look up font-lock-face, Dmitry Gutov, 2014/02/18
- [elpa] 10/14: company-capf: cache the capf data, Dmitry Gutov, 2014/02/18
- [elpa] 14/14: Merge commit '119822078ee3024c2d27017d45ef4578fa36040f' from company, Dmitry Gutov, 2014/02/18
- [elpa] 12/14: company-continue-commands: change the default value, Dmitry Gutov, 2014/02/18