[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 388545b 54/66: Add company-complete-common-or-cycle
From: |
Dmitry Gutov |
Subject: |
[elpa] master 388545b 54/66: Add company-complete-common-or-cycle |
Date: |
Tue, 13 Jan 2015 02:45:04 +0000 |
branch: master
commit 388545b74748447e710df3ff3899fcb1e4044c3b
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Add company-complete-common-or-cycle
---
NEWS.md | 2 ++
company.el | 10 ++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index b615f48..9d3c103 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,8 @@
## Next
+* New command `company-complete-common-or-cycle`. No default binding, so one
+ would have to set it up to use it.
* `company-search-toggle-filtering` replaced `company-search-kill-others`.
* Quitting the search mode resets the filtering.
* Pressing `backspace` in the search mode deletes the character at the end of
diff --git a/company.el b/company.el
index 217f37b..a92f837 100644
--- a/company.el
+++ b/company.el
@@ -1870,6 +1870,16 @@ and invoke the normal binding."
(when company-common
(company--insert-candidate company-common)))))
+(defun company-complete-common-or-cycle ()
+ "Insert the common part of all candidates, or select the next one."
+ (interactive)
+ (when (company-manual-begin)
+ (let ((tick (buffer-chars-modified-tick)))
+ (call-interactively 'company-complete-common)
+ (when (eq tick (buffer-chars-modified-tick))
+ (let ((company-selection-wrap-around t))
+ (call-interactively 'company-select-next))))))
+
(defun company-complete ()
"Insert the common part of all candidates or the current selection.
The first time this is called, the common part is inserted, the second
- [elpa] master 048a9c4 50/66: company-search-old-map: Remove, unused, (continued)
- [elpa] master 048a9c4 50/66: company-search-old-map: Remove, unused, Dmitry Gutov, 2015/01/12
- [elpa] master a850cdb 51/66: Privatize some search functions (and a var), Dmitry Gutov, 2015/01/12
- [elpa] master 7b312dd 52/66: Introduce `company-search-toggle-filtering', Dmitry Gutov, 2015/01/12
- [elpa] master 0d2757c 56/66: company-search-map: Add M-n and M-p bindings, Dmitry Gutov, 2015/01/12
- [elpa] master f5942e9 55/66: company-fill-propertize: Don't highlight match beg till common part, Dmitry Gutov, 2015/01/12
- [elpa] master aa7c1ca 57/66: Simplify NEWS entry, Dmitry Gutov, 2015/01/12
- [elpa] master eb1f0db 58/66: Fixup a test, Dmitry Gutov, 2015/01/12
- [elpa] master 9c99c7c 60/66: company-search-abort: Move predicate reset to the mode function, Dmitry Gutov, 2015/01/12
- [elpa] master 31d352f 53/66: Update NEWS.md, Dmitry Gutov, 2015/01/12
- [elpa] master 559b4f2 49/66: Don't repeat search with empty string, Dmitry Gutov, 2015/01/12
- [elpa] master 388545b 54/66: Add company-complete-common-or-cycle,
Dmitry Gutov <=
- [elpa] master 160ab01 63/66: Split company--process-candidates into -pre and -post, Dmitry Gutov, 2015/01/12
- [elpa] master 8f09f52 61/66: Replace `cl-plusp' usages with `string=', Dmitry Gutov, 2015/01/12
- [elpa] master 5b0f1c8 62/66: company-search-delete-char: Use `ding', Dmitry Gutov, 2015/01/12
- [elpa] master 5ebcae8 64/66: Improve duplicates removal, Dmitry Gutov, 2015/01/12
- [elpa] master 770d0d8 59/66: Work around http://debbugs.gnu.org/19553, Dmitry Gutov, 2015/01/12
- [elpa] master eb0d8d9 65/66: Release 0.8.8, Dmitry Gutov, 2015/01/12
- [elpa] master a95c2ce 42/66: Reorganize tests layout, Dmitry Gutov, 2015/01/12
- [elpa] master 092486e 66/66: Merge commit 'eb0d8d9e687e1364098f9abc6f9281fcbc0d3abd' from company, Dmitry Gutov, 2015/01/12