diff options
author | Kyle Meyer <kyle@kyleam.com> | 2021-05-23 17:46:21 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2021-05-23 17:47:53 -0400 |
commit | f62076dc33f562b085049f68df07cb140a35db20 (patch) | |
tree | 6c2a4278b2896b3c8c2a0ef7ca3397be9d04c96e | |
parent | 715d7501fca8ffd7c18b0ecec8f1d8550690d15d (diff) | |
download | piem-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.el | 1 | ||||
-rw-r--r-- | piem.el | 6 |
2 files changed, 3 insertions, 4 deletions
@@ -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 @@ -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 |