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

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

[elpa] master 22cc602 160/184: counsel.el (counsel-find-symbol): Should


From: Oleh Krehel
Subject: [elpa] master 22cc602 160/184: counsel.el (counsel-find-symbol): Should not show up in counsel-M-x
Date: Wed, 16 Oct 2019 13:15:14 -0400 (EDT)

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

    counsel.el (counsel-find-symbol): Should not show up in counsel-M-x
    
    * counsel.el (counsel-M-x): Filter out symbols that have the
      'no-counsel-M-x property.
    
    Fixes #2270
---
 counsel.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/counsel.el b/counsel.el
index 0a4b7b9..967f8f9 100644
--- a/counsel.el
+++ b/counsel.el
@@ -483,6 +483,7 @@ Used by commands `counsel-describe-variable' and
   "Jump to the definition of the current symbol."
   (interactive)
   (ivy-exit-with-action #'counsel--find-symbol))
+(put 'counsel-find-symbol 'no-counsel-M-x t)
 
 (defun counsel--info-lookup-symbol ()
   "Lookup the current symbol in the info docs."
@@ -912,10 +913,13 @@ when available, in that order of precedence."
   (setq real-this-command real-last-command)
   (let ((externs (counsel--M-x-externs)))
     (ivy-read (counsel--M-x-prompt) (or externs obarray)
-              :predicate (and (not externs)
-                              (lambda (sym)
-                                (and (commandp sym)
-                                     (not (get sym 'byte-obsolete-info)))))
+              :predicate (if externs
+                             (lambda (x)
+                               (not (get (intern x) 'no-counsel-M-x)))
+                           (lambda (sym)
+                             (and (commandp sym)
+                                  (not (get sym 'byte-obsolete-info))
+                                  (not (get sym 'no-counsel-M-x)))))
               :require-match t
               :history 'counsel-M-x-history
               :action #'counsel-M-x-action



reply via email to

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