[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 64b385d 107/348: Don't quit counsel-linux-app on bad data
From: |
Oleh Krehel |
Subject: |
[elpa] master 64b385d 107/348: Don't quit counsel-linux-app on bad data |
Date: |
Sat, 8 Apr 2017 11:03:37 -0400 (EDT) |
branch: master
commit 64b385dcbe0863c62f2ea594439504da81240bb3
Author: justbur <address@hidden>
Commit: Oleh Krehel <address@hidden>
Don't quit counsel-linux-app on bad data
* counsel.el (counsel-linux-apps-list): Don't throw error for bad
file. We can just skip the bad .desktop file and issue a warning.
Fixes #604
---
counsel.el | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/counsel.el b/counsel.el
index f4fb7a8..abf390e 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2275,26 +2275,26 @@ And insert it into the minibuffer. Useful during
(insert-file-contents (expand-file-name file
"/usr/share/applications"))
(let (name comment exec)
(goto-char (point-min))
- (if (re-search-forward "^Name *= *\\(.*\\)$" nil t)
- (setq name (match-string 1))
- (error "File %s has no Name" file))
- (goto-char (point-min))
- (when (re-search-forward "^Comment *= *\\(.*\\)$" nil t)
- (setq comment (match-string 1)))
- (goto-char (point-min))
- (when (re-search-forward "^Exec *= *\\(.*\\)$" nil t)
- (setq exec (match-string 1)))
- (if (and exec (not (equal exec "")))
- (add-to-list
- 'counsel-linux-apps-alist
- (cons (format "% -45s: %s%s"
- (propertize exec 'face 'font-lock-builtin-face)
- name
- (if comment
- (concat " - " comment)
- ""))
- file))
- (add-to-list 'counsel-linux-apps-faulty file))))))
+ (if (null (re-search-forward "^Name *= *\\(.*\\)$" nil t))
+ (message "Warning: File %s has no Name" file)
+ (setq name (match-string 1))
+ (goto-char (point-min))
+ (when (re-search-forward "^Comment *= *\\(.*\\)$" nil t)
+ (setq comment (match-string 1)))
+ (goto-char (point-min))
+ (when (re-search-forward "^Exec *= *\\(.*\\)$" nil t)
+ (setq exec (match-string 1)))
+ (if (and exec (not (equal exec "")))
+ (add-to-list
+ 'counsel-linux-apps-alist
+ (cons (format "% -45s: %s%s"
+ (propertize exec 'face 'font-lock-builtin-face)
+ name
+ (if comment
+ (concat " - " comment)
+ ""))
+ file))
+ (add-to-list 'counsel-linux-apps-faulty file)))))))
counsel-linux-apps-alist)
(defun counsel-linux-app-action-default (desktop-shortcut)
- [elpa] master d528f04 260/348: ivy.el (ivy--virtual-buffers): Don't modify recentfs or bookmarks, (continued)
- [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, 2017/04/08
- [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 <=
- [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
- [elpa] master c009b28 080/348: ivy.el: Breaking change for alist type collection actions, Oleh Krehel, 2017/04/08
- [elpa] master 8df5a67 089/348: counsel.el (counsel-semantic): New command, Oleh Krehel, 2017/04/08
- [elpa] master af5d2c1 097/348: Don't crash if default-directory is nil., Oleh Krehel, 2017/04/08
- [elpa] master 874632e 098/348: Name bookmarked directories using the bookmark name, Oleh Krehel, 2017/04/08
- [elpa] master 9e6bf2d 112/348: Makefile (plain): Fix target, Oleh Krehel, 2017/04/08