[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9ef344d 062/272: use imenu API to jump to position. requir
From: |
Oleh Krehel |
Subject: |
[elpa] master 9ef344d 062/272: use imenu API to jump to position. required by org-mode |
Date: |
Mon, 25 Apr 2016 10:13:16 +0000 |
branch: master
commit 9ef344d61148132199624b73f969d1719aa77b0d
Author: Chen Bin <address@hidden>
Commit: Oleh Krehel <address@hidden>
use imenu API to jump to position. required by org-mode
Fixes #364
---
counsel.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/counsel.el b/counsel.el
index 75ee2c6..682e238 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1405,13 +1405,15 @@ PREFIX is used to create the key."
(if (imenu--subalist-p elm)
(counsel-imenu-get-candidates-from
(cl-loop for (e . v) in (cdr elm) collect
- (cons e (if (integerp v) (copy-marker v) v)))
+ (cons e (if (integerp v) (copy-marker v) v)))
+ ;; pass the prefix to next recursive call
(concat prefix (if prefix ".") (car elm)))
- (list
- (cons (concat prefix (if prefix ".") (car elm))
- (if (overlayp (cdr elm))
- (overlay-start (cdr elm))
- (cdr elm))))))
+ (let ((key (concat prefix (if prefix ".") (car elm))))
+ (list (cons key
+ ;; create a imenu candidate here
+ (cons key (if (overlayp (cdr elm))
+ (overlay-start (cdr elm))
+ (cdr elm))))))))
alist))
;;;###autoload
@@ -1424,9 +1426,11 @@ PREFIX is used to create the key."
(items (imenu--make-index-alist t))
(items (delete (assoc "*Rescan*" items) items)))
(ivy-read "imenu items:" (counsel-imenu-get-candidates-from items)
- :action (lambda (pos)
+ :action (lambda (candidate)
(with-ivy-window
- (goto-char pos))))))
+ ;; In org-mode, (imenu candidate) will expand child
node
+ ;; after jump to the candidate position
+ (imenu candidate))))))
(defun counsel--descbinds-cands ()
(let ((buffer (current-buffer))
- [elpa] master 66e00ed 034/272: counsel: Add counsel-up-directory to find-file-map, (continued)
- [elpa] master 66e00ed 034/272: counsel: Add counsel-up-directory to find-file-map, Oleh Krehel, 2016/04/25
- [elpa] master e23c175 039/272: Insert intermediate candidates during async completions, Oleh Krehel, 2016/04/25
- [elpa] master bc4d4a8 043/272: swiper.el (swiper-font-lock-exclude): Add sauron-mode, Oleh Krehel, 2016/04/25
- [elpa] master 93d1adc 026/272: Properly support matching ignoring order, Oleh Krehel, 2016/04/25
- [elpa] master 9a6b5fd 042/272: Add rcirc-mode to swiper-font-lock-ensure-exclude, Oleh Krehel, 2016/04/25
- [elpa] master ec7da3f 075/272: ivy.el (ivy-help-file): Improve location, Oleh Krehel, 2016/04/25
- [elpa] master c76c005 045/272: Add feedback for sole ivy completion., Oleh Krehel, 2016/04/25
- [elpa] master 59c5f16 044/272: Special case empty ivy-count-format completion., Oleh Krehel, 2016/04/25
- [elpa] master 569c11e 017/272: ivy.el (ivy-completion-in-region): Use compact ivy-count-format, Oleh Krehel, 2016/04/25
- [elpa] master d996215 038/272: Add counsel-descbinds, Oleh Krehel, 2016/04/25
- [elpa] master 9ef344d 062/272: use imenu API to jump to position. required by org-mode,
Oleh Krehel <=
- [elpa] master 0a9780b 046/272: ivy.el (ivy--recompute-index): Update cl-position logic, Oleh Krehel, 2016/04/25
- [elpa] master 407ce2c 051/272: counsel.el (counsel-list-processes): New command, Oleh Krehel, 2016/04/25
- [elpa] master e3e1f51 052/272: ivy.el (ivy-ffap-url-functions): Customize "C-x C-f M-n", Oleh Krehel, 2016/04/25
- [elpa] master b39f409 056/272: counsel.el (counsel-unicode-char): Display hex codes in left column, Oleh Krehel, 2016/04/25
- [elpa] master eab714f 054/272: counsel.el (counsel-at-git-issue-p): New defun, Oleh Krehel, 2016/04/25
- [elpa] master 4696b89 057/272: ivy.el (ivy-switch-buffer-other-window): New command, Oleh Krehel, 2016/04/25
- [elpa] master 763d42b 048/272: Initialize `ivy-last` to empty state., Oleh Krehel, 2016/04/25
- [elpa] master c0c0f63 060/272: ivy.el (ivy-read): Fix extra actions for completing-read, Oleh Krehel, 2016/04/25
- [elpa] master 5f4bc14 058/272: counsel.el (counsel-rhythmbox-current-song): Preselect the current song, Oleh Krehel, 2016/04/25
- [elpa] master 2877ae1 063/272: ivy.el (ivy-ignore-buffers): New defcustom, Oleh Krehel, 2016/04/25