emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master ac1dc5b 034/348: counsel.el (counsel-company): New command


From: Oleh Krehel
Subject: [elpa] master ac1dc5b 034/348: counsel.el (counsel-company): New command
Date: Sat, 8 Apr 2017 11:03:18 -0400 (EDT)

branch: master
commit ac1dc5bcdfac0b4ae64122690ae22c755d73e790
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-company): New command
    
    Re #331
---
 counsel.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/counsel.el b/counsel.el
index 6eb5c5f..edab7c6 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2089,6 +2089,20 @@ And insert it into the minibuffer. Useful during
             :action #'counsel-linux-app-action-default
             :caller 'counsel-linux-app))
 
+;;;###autoload
+(defun counsel-company ()
+  "Complete using `company-candidates'."
+  (interactive)
+  (unless company-candidates
+    (company-complete))
+  (when company-point
+    (company-complete-common)
+    (when (looking-back company-common (line-beginning-position))
+      (setq ivy-completion-beg (match-beginning 0))
+      (setq ivy-completion-end (match-end 0)))
+    (ivy-read "company cand: " company-candidates
+              :action #'ivy-completion-in-region-action)))
+
 ;;** `counsel-mode'
 (defvar counsel-mode-map
   (let ((map (make-sparse-keymap)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]