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

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

[elpa] externals/ivy 2c23dae5ea 01/10: counsel.el (counsel--imenu-candid


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy 2c23dae5ea 01/10: counsel.el (counsel--imenu-candidates): Specialize python-mode
Date: Sun, 11 Sep 2022 08:15:32 -0400 (EDT)

branch: externals/ivy
commit 2c23dae5ea1159cbea9bd64f12c3b674357d3fe3
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    counsel.el (counsel--imenu-candidates): Specialize python-mode
    
    * counsel.el (counsel-imenu-action): No need for `with-ivy-window'
---
 counsel.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/counsel.el b/counsel.el
index 329968976f..bae16a8a3c 100644
--- a/counsel.el
+++ b/counsel.el
@@ -4705,9 +4705,12 @@ S will be of the form \"[register]: content\"."
                                      imenu-auto-rescan-maxout))
          (items (imenu--make-index-alist t))
          (items (delete (assoc "*Rescan*" items) items))
-         (items (if (eq major-mode 'emacs-lisp-mode)
-                    (counsel-imenu-categorize-functions items)
-                  items)))
+         (items (cond ((eq major-mode 'emacs-lisp-mode)
+                       (counsel-imenu-categorize-functions items))
+                      ((eq major-mode 'python-mode)
+                       (python-imenu-create-flat-index))
+                      (t
+                       items))))
     (counsel-imenu-get-candidates-from items)))
 
 (defun counsel-imenu-get-candidates-from (alist &optional prefix)
@@ -4747,8 +4750,7 @@ PREFIX is used to create the key."
       items)))
 
 (defun counsel-imenu-action (x)
-  (with-ivy-window
-    (imenu (cdr x))))
+  (imenu (cdr x)))
 
 (defvar counsel-imenu-history nil
   "History for `counsel-imenu'.")



reply via email to

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