branch: master
commit b5a43790e386d10cf7cb56740b350e6e8f981cfc
Author: Steven Allen <[email protected]>
Commit: Steven Allen <[email protected]>

    Hide linux applications when appropriate
    
    * counsel.el (counsel-linux-apps-list): Hide applications when =Type= isn't
      =Application=, or =Hidden= or =NoDisplay= are =true= (or =1=).
---
 counsel.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index 19c7695..1bfe16c 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2750,7 +2750,17 @@ And insert it into the minibuffer. Useful during
               (end (re-search-forward "^\\[" nil t))
               name comment exec)
           (catch 'break
-            (unless start (throw 'break))
+            (unless start (throw 'break nil))
+
+            (goto-char start)
+            (when (re-search-forward "^\\(Hidden\\|NoDisplay\\) *= 
*\\(1\\|true\\) *$" end t)
+              (throw 'break nil))
+            (setq name (match-string 1))
+
+            (goto-char start)
+            (unless (re-search-forward "^Type *= *Application *$" end t)
+              (throw 'break nil))
+            (setq name (match-string 1))
 
             (goto-char start)
             (unless (re-search-forward "^Name *= *\\(.+\\)$" end t)

Reply via email to