[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 b719f6b 2/2: Loosen strict parsing requirement fo
From: |
Mark Oteiza |
Subject: |
[Emacs-diffs] emacs-26 b719f6b 2/2: Loosen strict parsing requirement for desktop files |
Date: |
Mon, 25 Sep 2017 08:50:20 -0400 (EDT) |
branch: emacs-26
commit b719f6b20ba00c86d860be113d8a842bc384f2df
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>
Loosen strict parsing requirement for desktop files
There are other desktop-looking files, for instance those having to do
with MIME typess, that would benefit from being able to be read by this
function. It helps to have some flexibility.
* lisp/xdg.el (xdg-desktop-read-file): Remove an error condition.
* test/lisp/xdg-tests.el: Remove a test.
---
lisp/xdg.el | 2 --
test/lisp/xdg-tests.el | 3 ---
2 files changed, 5 deletions(-)
diff --git a/lisp/xdg.el b/lisp/xdg.el
index e962cd2..76106f4 100644
--- a/lisp/xdg.el
+++ b/lisp/xdg.el
@@ -197,8 +197,6 @@ Optional argument GROUP defaults to the string \"Desktop
Entry\"."
(unless (looking-at xdg-desktop-group-regexp)
(error "Expected group name! Instead saw: %s"
(buffer-substring (point) (point-at-eol))))
- (unless (equal (match-string 1) "Desktop Entry")
- (error "Wrong first group: %s" (match-string 1)))
(when group
(while (and (re-search-forward xdg-desktop-group-regexp nil t)
(not (equal (match-string 1) group)))))
diff --git a/test/lisp/xdg-tests.el b/test/lisp/xdg-tests.el
index e3c9a74..b80f5e8 100644
--- a/test/lisp/xdg-tests.el
+++ b/test/lisp/xdg-tests.el
@@ -42,9 +42,6 @@
(should (equal "frobnicate" (gethash "Exec" tab2))))
(should-error
(xdg-desktop-read-file
- (expand-file-name "wrong.desktop" xdg-tests-data-dir)))
- (should-error
- (xdg-desktop-read-file
(expand-file-name "malformed.desktop" xdg-tests-data-dir)))
(let ((tab (xdg-desktop-read-file
(expand-file-name "l10n.desktop" xdg-tests-data-dir)))