[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5d68a50 069/173: [Fix #317] Allow :sorted keyword in group
From: |
Dmitry Gutov |
Subject: |
[elpa] master 5d68a50 069/173: [Fix #317] Allow :sorted keyword in grouped backends |
Date: |
Thu, 23 Jun 2016 00:28:38 +0000 (UTC) |
branch: master
commit 5d68a504742d6e6a4f79882431f4648a0654a5b9
Author: Vitalie Spinu <address@hidden>
Commit: Vitalie Spinu <address@hidden>
[Fix #317] Allow :sorted keyword in grouped backends
---
company.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/company.el b/company.el
index c64f0d6..abace2c 100644
--- a/company.el
+++ b/company.el
@@ -429,6 +429,9 @@ the keyword `:with', the backends after it are ignored for
this command.
The completions from backends in a group are merged (but only from those
that return the same `prefix').
+If a grouped backend contains keyword `:sorted', the final (merged) list of
+candidates is not sorted.
+
Asynchronous backends:
The return value of each command can also be a cons (:async . FETCHER)
@@ -892,14 +895,17 @@ means that `company-mode' is always turned on except in
`message-mode' buffers."
when (not (and (symbolp b)
(eq 'failed (get b 'company-init))))
collect b)))
- (setq backends
- (if (eq command 'prefix)
- (butlast backends (length (member :with backends)))
- (delq :with backends)))
+
+ (when (eq command 'prefix)
+ (setq backends (butlast backends (length (member :with backends)))))
+
+ (unless (memq command '(sorted))
+ (setq backends (cl-delete-if #'keywordp backends)))
+
(pcase command
(`candidates
(company--multi-backend-adapter-candidates backends (car args)))
- (`sorted nil)
+ (`sorted (memq :sorted backends))
(`duplicates t)
((or `prefix `ignore-case `no-cache `require-match)
(let (value)
- [elpa] master 049b0e6 048/173: company--begin-new: Check the value of c, (continued)
- [elpa] master 049b0e6 048/173: company--begin-new: Check the value of c, Dmitry Gutov, 2016/06/22
- [elpa] master 250ca1c 088/173: Add company-etags-everywhere, Dmitry Gutov, 2016/06/22
- [elpa] master 21da29b 082/173: Update copyright, Dmitry Gutov, 2016/06/22
- [elpa] master cec8779 075/173: Introduce company-search-regexp-function, Dmitry Gutov, 2016/06/22
- [elpa] master 6165cb2 083/173: Don't "adjust key" (#422), Dmitry Gutov, 2016/06/22
- [elpa] master e5177c9 105/173: Add company-tooltip-annotation-selection face, Dmitry Gutov, 2016/06/22
- [elpa] master 75e21f6 045/173: company-css: Support web-mode, Dmitry Gutov, 2016/06/22
- [elpa] master e6ea779 004/173: Add `company-diag', Dmitry Gutov, 2016/06/22
- [elpa] master 0b37d17 044/173: company-mode: Mention the sorting order, Dmitry Gutov, 2016/06/22
- [elpa] master c6af7d2 061/173: Mention the previous change in NEWS [ci skip], Dmitry Gutov, 2016/06/22
- [elpa] master 5d68a50 069/173: [Fix #317] Allow :sorted keyword in grouped backends,
Dmitry Gutov <=
- [elpa] master 87351aa 073/173: Double space, Dmitry Gutov, 2016/06/22
- [elpa] master 8952cfe 085/173: Handle key prefix being shorter than prefix (#422), Dmitry Gutov, 2016/06/22
- [elpa] master c2e5981 017/173: Remove company-ropemacs, Dmitry Gutov, 2016/06/22
- [elpa] master d97c98f 076/173: company-search-candidates: Mention company-search-regexp-function, Dmitry Gutov, 2016/06/22
- [elpa] master 2306c9c 054/173: Support whitespace-mode newline-mark, Dmitry Gutov, 2016/06/22
- [elpa] master 4a16a55 090/173: company-dabbrev--make-regexp: Regexp can match non-word characters, Dmitry Gutov, 2016/06/22
- [elpa] master 1c36f7c 091/173: company-dabbrev--search-buffer: Use use forward search (#433), Dmitry Gutov, 2016/06/22
- [elpa] master da9b108 104/173: Refine the workaround further, Dmitry Gutov, 2016/06/22
- [elpa] master 6bf2491 102/173: Rename company-clang-obc-templatify to company-template-objc-templatify, Dmitry Gutov, 2016/06/22
- [elpa] master a95d7f1 081/173: Respect yas-key-syntaxes (#422), Dmitry Gutov, 2016/06/22