From f62076dc33f562b085049f68df07cb140a35db20 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 23 May 2021 17:46:21 -0400 Subject: 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> --- piem-b4.el | 1 - piem.el | 6 +++--- 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 -- cgit v1.2.3