diff options
| author | Mark Oteiza | 2017-09-25 08:45:08 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2017-09-25 08:45:08 -0400 |
| commit | b719f6b20ba00c86d860be113d8a842bc384f2df (patch) | |
| tree | 7453a5257f8f9d69aaee3f098d03fc3987716d1a | |
| parent | c7a0c137770be2ff5378a6c545fdea2d26e010f0 (diff) | |
| download | emacs-b719f6b20ba00c86d860be113d8a842bc384f2df.tar.gz emacs-b719f6b20ba00c86d860be113d8a842bc384f2df.zip | |
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.
| -rw-r--r-- | lisp/xdg.el | 2 | ||||
| -rw-r--r-- | test/lisp/xdg-tests.el | 3 |
2 files changed, 0 insertions, 5 deletions
diff --git a/lisp/xdg.el b/lisp/xdg.el index e962cd21a6c..76106f42586 100644 --- a/lisp/xdg.el +++ b/lisp/xdg.el | |||
| @@ -197,8 +197,6 @@ Optional argument GROUP defaults to the string \"Desktop Entry\"." | |||
| 197 | (unless (looking-at xdg-desktop-group-regexp) | 197 | (unless (looking-at xdg-desktop-group-regexp) |
| 198 | (error "Expected group name! Instead saw: %s" | 198 | (error "Expected group name! Instead saw: %s" |
| 199 | (buffer-substring (point) (point-at-eol)))) | 199 | (buffer-substring (point) (point-at-eol)))) |
| 200 | (unless (equal (match-string 1) "Desktop Entry") | ||
| 201 | (error "Wrong first group: %s" (match-string 1))) | ||
| 202 | (when group | 200 | (when group |
| 203 | (while (and (re-search-forward xdg-desktop-group-regexp nil t) | 201 | (while (and (re-search-forward xdg-desktop-group-regexp nil t) |
| 204 | (not (equal (match-string 1) group))))) | 202 | (not (equal (match-string 1) group))))) |
diff --git a/test/lisp/xdg-tests.el b/test/lisp/xdg-tests.el index e3c9a743e44..b80f5e85524 100644 --- a/test/lisp/xdg-tests.el +++ b/test/lisp/xdg-tests.el | |||
| @@ -42,9 +42,6 @@ | |||
| 42 | (should (equal "frobnicate" (gethash "Exec" tab2)))) | 42 | (should (equal "frobnicate" (gethash "Exec" tab2)))) |
| 43 | (should-error | 43 | (should-error |
| 44 | (xdg-desktop-read-file | 44 | (xdg-desktop-read-file |
| 45 | (expand-file-name "wrong.desktop" xdg-tests-data-dir))) | ||
| 46 | (should-error | ||
| 47 | (xdg-desktop-read-file | ||
| 48 | (expand-file-name "malformed.desktop" xdg-tests-data-dir))) | 45 | (expand-file-name "malformed.desktop" xdg-tests-data-dir))) |
| 49 | (let ((tab (xdg-desktop-read-file | 46 | (let ((tab (xdg-desktop-read-file |
| 50 | (expand-file-name "l10n.desktop" xdg-tests-data-dir))) | 47 | (expand-file-name "l10n.desktop" xdg-tests-data-dir))) |