[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 33fa81e 14/54: counsel.el (counsel-jedi): New command
From: |
Oleh Krehel |
Subject: |
[elpa] master 33fa81e 14/54: counsel.el (counsel-jedi): New command |
Date: |
Tue, 29 Sep 2015 14:09:51 +0000 |
branch: master
commit 33fa81e96bec29cf962448947f571360e693ebbf
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-jedi): New command
* counsel.el (counsel--py-action): New defun.
Add a few declares as well.
---
counsel.el | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/counsel.el b/counsel.el
index b97efc9..022eca4 100644
--- a/counsel.el
+++ b/counsel.el
@@ -94,6 +94,41 @@
(setq counsel-completion-end
(move-marker (make-marker) (point)))))
+(declare-function deferred:sync! "ext:deferred")
+(declare-function jedi:complete-request "ext:jedi-core")
+(declare-function jedi:ac-direct-matches "ext:jedi")
+
+(defun counsel-jedi ()
+ "Python completion at point."
+ (interactive)
+ (let ((bnd (bounds-of-thing-at-point 'symbol)))
+ (if bnd
+ (progn
+ (setq counsel-completion-beg (car bnd))
+ (setq counsel-completion-end (cdr bnd)))
+ (setq counsel-completion-beg nil)
+ (setq counsel-completion-end nil)))
+ (deferred:sync!
+ (jedi:complete-request))
+ (ivy-read "Symbol name: " (jedi:ac-direct-matches)
+ :action #'counsel--py-action))
+
+(defun counsel--py-action (symbol)
+ "Insert SYMBOL, erasing the previous one."
+ (when (stringp symbol)
+ (when counsel-completion-beg
+ (delete-region
+ counsel-completion-beg
+ counsel-completion-end))
+ (setq counsel-completion-beg
+ (move-marker (make-marker) (point)))
+ (insert symbol)
+ (setq counsel-completion-end
+ (move-marker (make-marker) (point)))
+ (when (equal (get-text-property 0 'symbol symbol) "f")
+ (insert "()")
+ (backward-char 1))))
+
(defvar counsel-describe-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-.") #'counsel-find-symbol)
@@ -813,6 +848,11 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
(mapconcat #'identity counsel-org-tags ":"))
"")))
+(defvar org-agenda-bulk-marked-entries)
+
+(declare-function org-get-at-bol "org")
+(declare-function org-agenda-error "org-agenda")
+
(defun counsel-org-tag-action (x)
(if (member x counsel-org-tags)
(progn
- [elpa] master updated (af81566 -> 8b73497), Oleh Krehel, 2015/10/07
- [elpa] master c9235c8 04/54: counsel-locate should use '' for the regex, Oleh Krehel, 2015/10/07
- [elpa] master 432bc7e 10/54: Set line-spacing to 0 in the minibuffer, Oleh Krehel, 2015/10/07
- [elpa] master 39dfc80 05/54: Fix :dynamic-collection not being sorted, Oleh Krehel, 2015/10/07
- [elpa] master 970b984 01/54: Fix up ivy-recentf and ivy-switch-buffer window-wise, Oleh Krehel, 2015/10/07
- [elpa] master b844b69 19/54: ivy.el (ivy--format-minibuffer-line): Use add-face-text-property, Oleh Krehel, 2015/10/07
- [elpa] master c78a306 09/54: ivy.el (ivy-kill-ring-save): Add and bind to "M-w", Oleh Krehel, 2015/10/07
- [elpa] master 6bf2913 25/54: Declare some SLIME functions, Oleh Krehel, 2015/10/07
- [elpa] master 5db65db 34/54: swiper.el (swiper--ivy): Fix compiler warning, Oleh Krehel, 2015/10/07
- [elpa] master 05d5e63 02/54: (counsel-locate): Allow customizing locate options, Oleh Krehel, 2015/10/07
- [elpa] master 33fa81e 14/54: counsel.el (counsel-jedi): New command,
Oleh Krehel <=
- [elpa] master 435f2b6 38/54: Add work-around for minibuffer not re-sizing for many frames, Oleh Krehel, 2015/10/07
- [elpa] master 438e51d 24/54: counsel.el (counsel-git-grep-function): Fix up, Oleh Krehel, 2015/10/07
- [elpa] master 478e4e4 32/54: Make line numbers in swiper into display properties, Oleh Krehel, 2015/10/07
- [elpa] master 8fccfd3 03/54: (counsel-locate): Support OS X, Oleh Krehel, 2015/10/07
- [elpa] master 7684455 15/54: counsel.el (counsel--py-action): Work with "C-M-n", Oleh Krehel, 2015/10/07
- [elpa] master 9a509df 47/54: ivy.el (ivy--resize-minibuffer-to-fit): Make compatible with 24.3, Oleh Krehel, 2015/10/07
- [elpa] master d5ae6a3 30/54: ivy.el (ivy--resize-minibuffer-to-fit): Make compatible with 24.3, Oleh Krehel, 2015/10/07
- [elpa] master d8d7ed4 42/54: Fix minibuffer collapses to one line, Oleh Krehel, 2015/10/07
- [elpa] master db8fb1b 39/54: Make "<left>" and "<right>" behave as in fundamental-mode, Oleh Krehel, 2015/10/07
- [elpa] master 8b73497 54/54: Merge commit 'ba49407c5b4c719dd5dcc298c260513abf0c70df' from swiper, Oleh Krehel, 2015/10/07