From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id iMowJ0XNqmBvLAAAsNZ9tg (envelope-from ); Sun, 23 May 2021 21:46:45 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sCdME0HNqmBubgAAB5/wlQ (envelope-from ); Sun, 23 May 2021 21:46:41 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1621806401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zbtI5sQcFro5mMkBM+vTE5dHvDvY55LN433MJqqWMVA=; b=Nb/Gz0YywquPAcwJEfsfczSushoXCQvgRzGTJfPco/w/oHW8TYrN5BgfUW3RnT8+cQbs19 +q3kynte8pl916EXSIT5PZ1WQAyqxHX5V+NBLcayeIK0pDpkX/pyWbRlkC7PtNw9131QKz av8IHwL668Xj6rUAJX6LWAOv8t6E1oiLE+6sCf2dQ2VWhmNGElvEDIGKGjVgWhyge/attm mfZfkuwnrPJR3hiTKdjeTkH0/uYS+pyCAWXzPlnBMEOb5bEYIsBEYH9GKnkGuim/p85tKd TZyVTTSZkkEmII47w/ysYHpDawL8cc9SobpfY9Am++AxFLLi+gEh8t6wwq4HcQ== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH 4/5] piem-gunzip-buffer: Absorb caching of gunzip check Date: Sun, 23 May 2021 17:46:22 -0400 Message-Id: <20210523214623.31331-5-kyle@kyleam.com> In-Reply-To: <20210523214623.31331-1-kyle@kyleam.com> References: <20210523214623.31331-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-TUID: Pdwio0bT+Jt1 Now that piem-gunzip-buffer handles the check for the gunzip executable, there's not much point in having a dedicated function. --- piem.el | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/piem.el b/piem.el index 20f2f8b..25b7afe 100644 --- a/piem.el +++ b/piem.el @@ -529,14 +529,10 @@ (defun piem-copy-mid-url (&optional browse) ;;;; Download helpers (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-gunzip-buffer () - (unless (piem-check-gunzip) + (unless (if (boundp 'piem--has-gunzip) + piem--has-gunzip + (setq piem--has-gunzip (executable-find "gunzip"))) (user-error "gunzip executable not found")) (goto-char (point-min)) (unless (= 0 (call-process-region nil nil "gunzip" nil t)) -- 2.31.1