[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 99ce60b 125/173: Add company-search-flex-regexp
From: |
Dmitry Gutov |
Subject: |
[elpa] master 99ce60b 125/173: Add company-search-flex-regexp |
Date: |
Thu, 23 Jun 2016 00:28:44 +0000 (UTC) |
branch: master
commit 99ce60bc4f8e669163f02b5169399ca481461545
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Add company-search-flex-regexp
#460
---
company.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/company.el b/company.el
index 0735630..2381e9d 100644
--- a/company.el
+++ b/company.el
@@ -1641,7 +1641,9 @@ each one wraps a part of the input string."
(const :tag "Exact match" regexp-quote)
(const :tag "Words separated with spaces"
company-search-words-regexp)
(const :tag "Words separated with spaces, in any order"
- company-search-words-in-any-order-regexp)))
+ company-search-words-in-any-order-regexp)
+ (const :tag "All characters in given order, with anything in between"
+ company-search-flex-regexp)))
(defvar-local company-search-string "")
@@ -1671,6 +1673,15 @@ each one wraps a part of the input string."
permutations
"\\|")))
+(defun company-search-flex-regexp (input)
+ (if (zerop (length input))
+ ""
+ (concat (regexp-quote (string (aref input 0)))
+ (mapconcat (lambda (c)
+ (concat "[^" (string c) "]*"
+ (regexp-quote (string c))))
+ (substring input 1) ""))))
+
(defun company--permutations (lst)
(if (not lst)
'(nil)
- [elpa] master 387b4d1 106/173: Fix "obsolete function" warning, (continued)
- [elpa] master 387b4d1 106/173: Fix "obsolete function" warning, Dmitry Gutov, 2016/06/22
- [elpa] master 0a6bfa9 108/173: company-capf: Add :company-prefix-length property function, Dmitry Gutov, 2016/06/22
- [elpa] master 1f5389b 146/173: Merge pull request #483 from stardiviner/add-julia-keywords, Dmitry Gutov, 2016/06/22
- [elpa] master 6c8763a 151/173: Fixed lighter for grouped backends, Dmitry Gutov, 2016/06/22
- [elpa] master 7d0db9e 135/173: Move company-files closer to the front of company-backends, Dmitry Gutov, 2016/06/22
- [elpa] master b001e91 099/173: Fix a test (after adding `should`), Dmitry Gutov, 2016/06/22
- [elpa] master 779de03 117/173: Merge pull request #457 from cpitclaudel/wip-simplify-electric, Dmitry Gutov, 2016/06/22
- [elpa] master faa8f84 120/173: Add company-semantic-insert-arguments, Dmitry Gutov, 2016/06/22
- [elpa] master c357d5a 144/173: company-grab-line: Make it work in ERC prompt, Dmitry Gutov, 2016/06/22
- [elpa] master a53911c 130/173: Separate sort of candidates and children in company-files, Dmitry Gutov, 2016/06/22
- [elpa] master 99ce60b 125/173: Add company-search-flex-regexp,
Dmitry Gutov <=
- [elpa] master ada2ede 128/173: Merge pull request #461 from rlph/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master c38d382 147/173: Fixed typo, Dmitry Gutov, 2016/06/22
- [elpa] master 1275cdd 141/173: Bump copyright, Dmitry Gutov, 2016/06/22
- [elpa] master 4f0d7a1 131/173: Kill trailing / on directories completion, Dmitry Gutov, 2016/06/22
- [elpa] master 1de23f8 148/173: Merge pull request #486 from akirakyle/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master c12216b 140/173: re-sort, Dmitry Gutov, 2016/06/22
- [elpa] master e525793 143/173: company-dabbrev--search-buffer: Speed up, Dmitry Gutov, 2016/06/22
- [elpa] master 7d2d49b 150/173: company--fetch-candidates: Bind non-essential, Dmitry Gutov, 2016/06/22
- [elpa] master 90ec4ce 153/173: Don't call company-abort right after startup, Dmitry Gutov, 2016/06/22
- [elpa] master d48eaee 155/173: Merge pull request #499 from fice-t/autoload, Dmitry Gutov, 2016/06/22