aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-05-23 17:46:21 -0400
committerKyle Meyer <kyle@kyleam.com>2021-05-23 17:47:53 -0400
commitf62076dc33f562b085049f68df07cb140a35db20 (patch)
tree6c2a4278b2896b3c8c2a0ef7ca3397be9d04c96e
parent715d7501fca8ffd7c18b0ecec8f1d8550690d15d (diff)
downloadpiem-f62076dc33f562b085049f68df07cb140a35db20.tar.gz
piem-gunzip-buffer: Check for gunzip executable
Make piem-gunzip-buffer handle the executable check so that callers don't have to worry about it. Message-Id: <20210523214623.31331-4-kyle@kyleam.com>
-rw-r--r--piem-b4.el1
-rw-r--r--piem.el6
2 files changed, 3 insertions, 4 deletions
diff --git a/piem-b4.el b/piem-b4.el
index 92ddea8..e76953e 100644
--- a/piem-b4.el
+++ b/piem-b4.el
@@ -73,7 +73,6 @@ This is intended to be used for debugging purposes.")
;; back to b4's configuration.
(unless local-mbox-p
(when-let ((url (and (equal mid (piem-mid))
- (piem-check-gunzip)
(piem-inbox-get :url))))
(ignore-errors
(piem-with-url-contents
diff --git a/piem.el b/piem.el
index 7bda1cf..1d10739 100644
--- a/piem.el
+++ b/piem.el
@@ -536,6 +536,8 @@ is used as the value of `browse-url-browser-function'."
piem--has-gunzip)
(defun piem-gunzip-buffer ()
+ (unless (piem-check-gunzip)
+ (user-error "gunzip executable not found"))
(goto-char (point-min))
(unless (= 0 (call-process-region nil nil "gunzip" nil t))
(error "Decompressing t.mbox.gz failed"))
@@ -630,9 +632,7 @@ This function depends on :url being configured for entries in
(user-error "No directory returned by `piem-inbox-maildir-directory'"))
((not (piem-maildir-dir-is-maildir-p maildir-directory))
(user-error
- "Does not look like a Maildir directory: %s" maildir-directory))
- ((not (or message-only (piem-check-gunzip)))
- (user-error "gunzip executable not found")))
+ "Does not look like a Maildir directory: %s" maildir-directory)))
(let ((url (concat (piem-mid-url mid)
(if message-only "/raw" "/t.mbox.gz"))))
(piem-with-url-contents url