emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hyperdrive 1759da77fd 10/21: Tidy: (h//context-entry) Use


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 1759da77fd 10/21: Tidy: (h//context-entry) Use thunk-let
Date: Wed, 21 Aug 2024 01:10:09 -0400 (EDT)

branch: elpa/hyperdrive
commit 1759da77fd980f6f5fc0bfe6120f3a3eb96206d0
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Tidy: (h//context-entry) Use thunk-let
---
 hyperdrive-lib.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 38d37b355b..4af10c7048 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -32,6 +32,7 @@
 (require 'seq)
 (require 'url-util)
 (require 'gv)
+(require 'thunk)
 
 (require 'compat)
 (require 'persist)
@@ -1156,14 +1157,12 @@ default to `hyperdrive-formats', which see."
   "Return the current entry in the current context.
 LATEST-VERSION is passed to `hyperdrive-read-entry'.  With
 FORCE-PROMPT, prompt for entry."
-  (cond (force-prompt
-         (h/read-entry
-          :hyperdrive (h//context-hyperdrive :force-prompt force-prompt)
-          :read-version t :latest-version latest-version))
-        ((derived-mode-p 'h/dir-mode) (h/dir--entry-at-point))
-        (t (or h/current-entry
-               (h/read-entry :hyperdrive (h//context-hyperdrive)
-                             :latest-version latest-version)))))
+  (thunk-let ((read-entry (h/read-entry
+                           :hyperdrive (h//context-hyperdrive :force-prompt 
force-prompt)
+                           :read-version t :latest-version latest-version)))
+    (cond (force-prompt read-entry)
+          ((derived-mode-p 'h/dir-mode) (h/dir--entry-at-point))
+          (t (or h/current-entry read-entry)))))
 
 (cl-defun h//context-hyperdrive (&key predicate force-prompt)
   "Return hyperdrive for current entry when it matches PREDICATE.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]