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

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

[elpa] master 722250c 162/184: counsel.el (counsel-imenu-action): Handle


From: Oleh Krehel
Subject: [elpa] master 722250c 162/184: counsel.el (counsel-imenu-action): Handle nil case
Date: Wed, 16 Oct 2019 13:15:15 -0400 (EDT)

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

    counsel.el (counsel-imenu-action): Handle nil case
    
    In case there is no match, and :update-fn is 'auto, it will call the
    action with nil.
    
    The action is called with nil, so that functions like
    `swiper-isearch-action` can clean up.
    
    Re #2188
---
 counsel.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/counsel.el b/counsel.el
index 48b1214..84e83bb 100644
--- a/counsel.el
+++ b/counsel.el
@@ -4324,8 +4324,9 @@ PREFIX is used to create the key."
                `(("Functions" ,@fns)))
       items)))
 
-(defun counsel-imenu-action (candidate)
-  (goto-char (cdr candidate)))
+(defun counsel-imenu-action (x)
+  (when x
+    (goto-char (cdr x))))
 
 ;;;###autoload
 (defun counsel-imenu ()



reply via email to

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