From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id GLNyHITeOV+uDQAAsNZ9tg (envelope-from ) for ; Mon, 17 Aug 2020 01:33:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6NtGGITeOV9dWAAAB5/wlQ (envelope-from ) for ; Mon, 17 Aug 2020 01:33:56 +0000 Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7A2F694053D for ; Mon, 17 Aug 2020 01:33:55 +0000 (UTC) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 86143683DA; Sun, 16 Aug 2020 21:33:54 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=fhila8hDvDrwztgN68YLVV4O9 MU=; b=M/pfMs7W8VoS3LWLt1z0srOqrMa+LovXFL0JbZYo5zDo0QLZ3Uemdfn9G 0ZIv5nljhQmRmqidK0FkRfan8qG5QFJ3cCjddItTuNE+pNJtkE/YIUEM4HmKHUR0 IE3jpCtM0XaaGDuYkxoRZwaTiHOdgPlJ0PXghmJLywgaD6tUSM= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 7E5BA683D8; Sun, 16 Aug 2020 21:33:54 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=mesmtp; bh=WGcVb1TowxctZ4H72VcZ370kKu26O5RRRsnCrJUQAMM=; b=WYO46arkyRQQTEoIOTHMn/4rMbCmnJJXiwewoIl5Fc66oucVKhaqBWapHrk8v5f6kkiTAzz460UC4uM24dl61dDIgy5Y9IMlET4mcbarZrnNad212g6+Tll7DQQaDFhUy+6qr81v/8OGHWLraCMbP95G508Vz3EApOuut6PJavM= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id EF14C683D7; Sun, 16 Aug 2020 21:33:53 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH 2/5] Move "has gunzip?" check to helper Date: Sun, 16 Aug 2020 21:33:40 -0400 Message-Id: <20200817013343.15615-3-kyle@kyleam.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817013343.15615-1-kyle@kyleam.com> References: <20200817013343.15615-1-kyle@kyleam.com> MIME-Version: 1.0 X-Pobox-Relay-ID: B6006D7C-E029-11EA-B043-01D9BED8090B-24757444!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=M/pfMs7W; dkim=fail (body hash did not verify) header.d=kyleam.com header.s=mesmtp header.b=WYO46ark; dmarc=none; spf=pass (aspmx1.migadu.com: domain of kyle@kyleam.com designates 64.147.108.70 as permitted sender) smtp.mailfrom=kyle@kyleam.com X-Spam-Score: 2.50 X-TUID: qOhH7FTdiM4Y This will be needed in another spot. --- piem.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/piem.el b/piem.el index bcbec78..4b35938 100644 --- a/piem.el +++ b/piem.el @@ -365,6 +365,13 @@ (defun piem-am-ready-mbox () =0C ;;;; Maildir injection =20 +(defvar piem--has-gunzip) +(defun piem-check-gunzip () + "Return non-nil if gunzip is available." + (unless (boundp 'piem--has-gunzip) + (setq piem--has-gunzip (executable-find "gunzip"))) + piem--has-gunzip) + (defun piem--write-mbox-to-maildir () (let ((n-messages 0)) (while (and (not (eobp)) @@ -413,8 +420,6 @@ (defun piem--inject-thread-callback (status mid messa= ge-only) (and (buffer-live-p buffer) (kill-buffer buffer))))) =20 -(defvar piem--has-gunzip) - ;;;###autoload (defun piem-inject-thread-into-maildir (mid &optional message-only) "Inject thread containing MID into `piem-maildir-directory'. @@ -428,15 +433,13 @@ (defun piem-inject-thread-into-maildir (mid &option= al message-only) (list (or (piem-mid) (user-error "No message ID found for the current buffer")) current-prefix-arg)) - (unless (or message-only (boundp 'piem--has-gunzip)) - (setq piem--has-gunzip (executable-find "gunzip"))) (cond ((not piem-maildir-directory) (user-error "`piem-maildir-directory' is not configured")) ((not (piem-maildir-dir-is-maildir-p piem-maildir-directory)) (user-error "`piem-maildir-directory' does not look like a Maildir directory")) - ((not (or message-only piem--has-gunzip)) + ((not (or message-only (piem-check-gunzip))) (user-error "gunzip executable not found"))) (url-retrieve (concat (or (piem-inbox-url) (user-error --=20 2.28.0