[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1d32ceb 332/348: counsel.el (counsel-irony): New command
From: |
Oleh Krehel |
Subject: |
[elpa] master 1d32ceb 332/348: counsel.el (counsel-irony): New command |
Date: |
Sat, 8 Apr 2017 11:04:25 -0400 (EDT) |
branch: master
commit 1d32ceb704af74b113fd6ffadd2394f760d64ba9
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-irony): New command
---
counsel.el | 35 ++++++++++++++++++++++++++++++++++-
swiper.el | 1 +
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/counsel.el b/counsel.el
index 7ec3a7b..9db9049 100644
--- a/counsel.el
+++ b/counsel.el
@@ -3240,7 +3240,40 @@ candidate."
:history 'counsel-org-agenda-headlines-history
:caller 'counsel-org-agenda-headlines)))
-;** `counsel-mode'
+;;** `counsel-irony'
+;;;###autoload
+(defun counsel-irony ()
+ "Inline C/C++ completion using Irony."
+ (interactive)
+ (irony-completion-candidates-async 'counsel-irony-callback))
+
+(defun counsel-irony-callback ()
+ (interactive)
+ (let ((coll (irony-completion-at-point)))
+ (when coll
+ (setq ivy-completion-beg (nth 0 coll))
+ (setq ivy-completion-end (nth 1 coll))
+ (ivy-read "code: " (mapcar #'counsel-irony-annotate
+ (nth 2 coll))
+ :caller 'counsel-irony
+ :action 'ivy-completion-in-region-action))))
+
+(defun counsel-irony-annotate (x)
+ (cons
+ (condition-case nil
+ (concat
+ x " "
+ (irony-completion--at-point-annotate x))
+ (error x))
+ x))
+
+(add-to-list 'ivy-display-functions-alist '(counsel-irony .
ivy-display-function-overlay))
+
+(declare-function irony-completion-candidates-async "ext:irony-completion")
+(declare-function irony-completion-at-point "ext:irony-completion")
+(declare-function irony-completion--at-point-annotate "ext:irony-completion")
+
+;;** `counsel-mode'
(defvar counsel-mode-map
(let ((map (make-sparse-keymap)))
(dolist (binding
diff --git a/swiper.el b/swiper.el
index ce7c07c..7aa2875 100644
--- a/swiper.el
+++ b/swiper.el
@@ -139,6 +139,7 @@
(declare-function avy--process "ext:avy")
(declare-function avy--overlay-post "ext:avy")
(declare-function avy-action-goto "ext:avy")
+(declare-function avy-candidate-beg "ext:avy")
(declare-function avy--done "ext:avy")
(declare-function avy--make-backgrounds "ext:avy")
(declare-function avy-window-list "ext:avy")
- [elpa] master 4232088 265/348: Don't claim `swiper' provides `ivy-mode', (continued)
- [elpa] master 4232088 265/348: Don't claim `swiper' provides `ivy-mode', Oleh Krehel, 2017/04/08
- [elpa] master ee0d9e3 275/348: ivy.el (ivy--reset-state): Simplify, Oleh Krehel, 2017/04/08
- [elpa] master abdbfa7 273/348: counsel.el: Add counsel-org-agenda-headlines, Oleh Krehel, 2017/04/08
- [elpa] master 482c3e9 279/348: counsel.el (counsel-ace-link): Use `cdr' for action., Oleh Krehel, 2017/04/08
- [elpa] master e4c248a 278/348: doc/ivy.org: Update package names in ELPA/MELPA, Oleh Krehel, 2017/04/08
- [elpa] master 6e6738c 294/348: counsel.el (counsel-git-grep-cmd-default): Use '%s' quoting, Oleh Krehel, 2017/04/08
- [elpa] master d4e5d79 290/348: counsel.el (counsel-package): Fix sorting issue, Oleh Krehel, 2017/04/08
- [elpa] master 15f89f7 295/348: ivy.el (ivy-minibuffer-map): Bind "C-v" and scroll-up-command, Oleh Krehel, 2017/04/08
- [elpa] master ab6561f 321/348: ivy.el: Use set-ivy-index instead of setq ivy--index, Oleh Krehel, 2017/04/08
- [elpa] master 45383fe 330/348: ivy-overlay.el (ivy-display-function-overlay): Put overlay at symbol start, Oleh Krehel, 2017/04/08
- [elpa] master 1d32ceb 332/348: counsel.el (counsel-irony): New command,
Oleh Krehel <=
- [elpa] master ace01d5 347/348: ivy.el (ivy-immediate-done): Fix for rgrep, Oleh Krehel, 2017/04/08
- [elpa] master 2f5bfc0 144/348: counsel.el (counsel-dpkg): New command, Oleh Krehel, 2017/04/08
- [elpa] master d7a1fda 143/348: swiper.el (swiper-all): "M-q" calls query-replace, Oleh Krehel, 2017/04/08
- [elpa] master 5a4ede4 130/348: Fix swiper-all for ivy--regex-ignore-order, Oleh Krehel, 2017/04/08
- [elpa] master 5787780 137/348: Makefile (plain): Print version, Oleh Krehel, 2017/04/08
- [elpa] master 72784c1 149/348: counsel.el (counsel-imenu): Force rescan if requested, Oleh Krehel, 2017/04/08
- [elpa] master 01b0195 306/348: Correct Circe major-modes in ...-font-lock-exclude, Oleh Krehel, 2017/04/08
- [elpa] master 94a466f 341/348: ivy.el: Clean up whitespace, Oleh Krehel, 2017/04/08
- [elpa] master 1220781 131/348: counsel.el (counsel-find-file): Speed up opening remotes, Oleh Krehel, 2017/04/08
- [elpa] master 63dd0d3 134/348: counsel.el (counsel-git-grep-proj-function): Use greedy regex, Oleh Krehel, 2017/04/08