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

    Support TryExec in desktop files
    
    * counsel.el (counsel-linux-apps-list): Ignore desktop files where the 
program
      specified in the =TryExec= field either doesn't exist or isn't executable 
by
      the current user.
---
 counsel.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/counsel.el b/counsel.el
index 1af8f63..06d6004 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2778,6 +2778,12 @@ And insert it into the minibuffer. Useful during
               (throw 'break nil))
             (setq exec (match-string 1))
 
+            (goto-char start)
+            (when (re-search-forward "^TryExec *= *\\(.+\\)$" end t)
+              (let ((try-exec (match-string 1)))
+                (unless (locate-file try-exec exec-path nil 
#'file-executable-p)
+                  (throw 'break nil))))
+
             (push
              (cons (format "% -45s: %s%s"
                            (propertize exec 'face 'font-lock-builtin-face)

Reply via email to