[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0507841 285/348: Use customizable list of directories when
From: |
Oleh Krehel |
Subject: |
[elpa] master 0507841 285/348: Use customizable list of directories when looking for linux apps. |
Date: |
Sat, 8 Apr 2017 11:04:16 -0400 (EDT) |
branch: master
commit 0507841d6732a1dca231c19c62780650e2488c77
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Use customizable list of directories when looking for linux apps.
* counsel.el (counsel-linux-apps-directories): New variable.
(counsel-linux-apps-list): Use it.
---
counsel.el | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/counsel.el b/counsel.el
index b76f938..6c77df3 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2617,16 +2617,23 @@ And insert it into the minibuffer. Useful during
(defvar counsel-linux-apps-faulty nil
"List of faulty data located in /usr/share/applications.")
+(defcustom counsel-linux-apps-directories
+ '("/usr/local/share/applications/" "/usr/share/applications/")
+ "Directories in which to search for applications (.desktop files)."
+ :group 'counsel
+ :type '(list directory))
+
(defun counsel-linux-apps-list ()
- (let ((files
- (delete
- ".." (delete
- "." (file-expand-wildcards
"/usr/share/applications/*.desktop")))))
+ (let ((files (apply 'append
+ (mapcar
+ (lambda (dir)
+ (directory-files dir t ".*\\.desktop$"))
+ counsel-linux-apps-directories))))
(dolist (file (cl-set-difference files (append (mapcar 'car
counsel-linux-apps-alist)
counsel-linux-apps-faulty)
:test 'equal))
(with-temp-buffer
- (insert-file-contents (expand-file-name file
"/usr/share/applications"))
+ (insert-file-contents file)
(let (name comment exec)
(goto-char (point-min))
(if (null (re-search-forward "^Name *= *\\(.*\\)$" nil t))
- [elpa] master 2ed3da4 252/348: counsel.el: Fix byte-compile warning, (continued)
- [elpa] master 2ed3da4 252/348: counsel.el: Fix byte-compile warning, Oleh Krehel, 2017/04/08
- [elpa] master 09da543 253/348: swiper.el: Ease the creation of swiper-in-region functions, Oleh Krehel, 2017/04/08
- [elpa] master 3940f17 266/348: Fix typos, Oleh Krehel, 2017/04/08
- [elpa] master 25ac29f 079/348: ivy.el (ivy-completion-in-region): Avoid error for 0 candidates, Oleh Krehel, 2017/04/08
- [elpa] master 0572f16 123/348: swiper now respects ivy-re-builders-alist, Oleh Krehel, 2017/04/08
- [elpa] master d528f04 260/348: ivy.el (ivy--virtual-buffers): Don't modify recentfs or bookmarks, Oleh Krehel, 2017/04/08
- [elpa] master ed579dd 274/348: ivy.el: Fix ivy-highlight-functions-alist, Oleh Krehel, 2017/04/08
- [elpa] master 9151862 277/348: ivy.el (ivy--format-minibuffer-line): Fix for ivy-display-style nil, Oleh Krehel, 2017/04/08
- [elpa] master 6cf7feb 282/348: ivy.el: Allow toggling of sorting in ivy-read, Oleh Krehel, 2017/04/08
- [elpa] master dbcee94 288/348: counsel.el: support universal argument for counsel-unicode-char, Oleh Krehel, 2017/04/08
- [elpa] master 0507841 285/348: Use customizable list of directories when looking for linux apps.,
Oleh Krehel <=
- [elpa] master 7c73f71 293/348: Allow users to find libraries from counsel-load-library, Oleh Krehel, 2017/04/08
- [elpa] master 07813be 094/348: Spelling fixes, Oleh Krehel, 2017/04/08
- [elpa] master 22623aa 101/348: swiper.el (swiper-avy): Require avy, Oleh Krehel, 2017/04/08
- [elpa] master 9118fa1 093/348: Separate readme into distinct ivy/counsel/swiper sections, Oleh Krehel, 2017/04/08
- [elpa] master 64b385d 107/348: Don't quit counsel-linux-app on bad data, Oleh Krehel, 2017/04/08
- [elpa] master 2be454c 104/348: Remove ivy-height from the example configuration., Oleh Krehel, 2017/04/08
- [elpa] master d83567e 073/348: counsel.el (counsel-locate-options): Remove obsolete var, Oleh Krehel, 2017/04/08
- [elpa] master e89f250 072/348: Add option for swiper line number to be searchable, Oleh Krehel, 2017/04/08
- [elpa] master 06d5cf5 078/348: counsel.el (counsel-rhythmbox): Require dbus, Oleh Krehel, 2017/04/08
- [elpa] master 469a4ab 081/348: Add ivy-push-view and ivy-pop-view, Oleh Krehel, 2017/04/08