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

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

[nongnu] elpa/hyperdrive 828f47e6e4 03/21: Tidy: (h//context-entry) Use


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 828f47e6e4 03/21: Tidy: (h//context-entry) Use cond instead of pcase
Date: Wed, 21 Aug 2024 01:10:07 -0400 (EDT)

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

    Tidy: (h//context-entry) Use cond instead of pcase
---
 hyperdrive-lib.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index e58ccba3e7..53cf11466b 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1156,11 +1156,10 @@ default to `hyperdrive-formats', which see."
   "Return the current entry in the current context.
 LATEST-VERSION is passed to `hyperdrive-read-entry'.
 With universal prefix argument \\[universal-argument], prompt for entry."
-  (pcase major-mode
-    ((guard current-prefix-arg)
-     (h/read-entry :read-version t :latest-version latest-version))
-    ('h/dir-mode (h/dir--entry-at-point))
-    (_ (or h/current-entry (h/read-entry :latest-version latest-version)))))
+  (cond (current-prefix-arg
+         (h/read-entry :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 :latest-version 
latest-version)))))
 
 (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]