discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
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	[thread overview]
Message-ID: <20210523214623.31331-5-kyle@kyleam.com> (raw)
In-Reply-To: <20210523214623.31331-1-kyle@kyleam.com>

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


  parent reply	other threads:[~2021-05-23 21:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23 21:46 [PATCH 0/5] Rework url-retrieve-synchronously wrapper Kyle Meyer
2021-05-23 21:46 ` [PATCH 1/5] b4: Check for message ID match when using current buffer's URL Kyle Meyer
2021-05-23 21:46 ` [PATCH 2/5] Rework url-retrieve-synchronously wrapper Kyle Meyer
2021-05-23 21:46 ` [PATCH 3/5] piem-gunzip-buffer: Check for gunzip executable Kyle Meyer
2021-05-23 21:46 ` Kyle Meyer [this message]
2021-05-23 21:46 ` [PATCH 5/5] piem-gunzip-buffer: Don't assume t.mbox.gz is being decompressed Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://git.kyleam.com/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210523214623.31331-5-kyle@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.kyleam.com/piem/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).