[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive 13aff2f505 094/123: Change: (hyperdrive-menu) M
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive 13aff2f505 094/123: Change: (hyperdrive-menu) Move version section |
Date: |
Fri, 6 Oct 2023 01:01:08 -0400 (EDT) |
branch: elpa/hyperdrive
commit 13aff2f505c647c182685c709e197ec922e4368a
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Change: (hyperdrive-menu) Move version section
Also move hyperdrive commands into -menu-hyperdrive.
---
hyperdrive-menu.el | 120 +++++++++++++++++++++++++++--------------------------
1 file changed, 61 insertions(+), 59 deletions(-)
diff --git a/hyperdrive-menu.el b/hyperdrive-menu.el
index 19c2849b8c..d8cb6d8d4f 100644
--- a/hyperdrive-menu.el
+++ b/hyperdrive-menu.el
@@ -55,22 +55,65 @@
(transient-define-prefix hyperdrive-menu (entry)
"Show the hyperdrive transient menu."
[ :class transient-row
- :description "Hyperdrive"
- ("H e" "Edit" hyperdrive-menu-hyperdrive)
- ("H n" "New" hyperdrive-new)
- ("H d" "Describe" hyperdrive-describe-hyperdrive)
- ("H P" "Purge" hyperdrive-purge)
+ :description
+ (lambda ()
+ (if-let* ((entry (oref transient--prefix scope))
+ (hyperdrive (hyperdrive-entry-hyperdrive entry)))
+ (concat (propertize "Hyperdrive: " 'face 'transient-heading)
+ (hyperdrive--format-hyperdrive hyperdrive :formats
'(short-key seed domain nickname petname))
+ ;; TODO: Consider moving the latest version number into the
"Version" group.
+ (format " latest:%s" (hyperdrive-latest-version
hyperdrive)))
+ "Hyperdrive"))
+ ("h" "Hyperdrive menu" hyperdrive-menu-hyperdrive)
;; TODO: Hook into transient-show-help?
("?" "Help" hyperdrive-info-manual)]
[ :if (lambda () (oref transient--prefix scope))
- :description
- (lambda ()
- (let ((hyperdrive (hyperdrive-entry-hyperdrive (oref transient--prefix
scope))))
- (concat (propertize "Inside: " 'face 'transient-heading)
- (hyperdrive--format-hyperdrive hyperdrive :formats '(short-key
seed domain nickname petname))
- ;; TODO: Consider moving the latest version number into the
"Version" group.
- (format " latest:%s" (hyperdrive-latest-version hyperdrive))
- "\n")))
+
+ ["Version"
+ :class transient-row
+ :description (lambda ()
+ (if-let ((entry (oref transient--prefix scope))
+ (hyperdrive (hyperdrive-entry-hyperdrive entry)))
+ (concat (propertize "Version: "
+ 'face 'transient-heading)
+ (propertize (format "%s"
+ (or
(hyperdrive-entry-version entry)
+ "latest"))
+ 'face 'transient-value))
+ "Version"))
+ ("V h" "History" hyperdrive-history)
+ ("V n" "Next" hyperdrive-next-version
+ :inapt-if-not (lambda ()
+ (let ((entry (oref transient--prefix scope)))
+ (and (hyperdrive-entry-version entry)
+ (hyperdrive-entry-next entry))))
+ ;; :transient t
+ :description (lambda ()
+ (concat "Next"
+ (when-let* ((entry (oref transient--prefix scope))
+ (hyperdrive
(hyperdrive-entry-hyperdrive entry))
+ (next-entry (hyperdrive-entry-next
entry))
+ ;; Don't add ": latest" if we're
already at the latest version
+ ((not (eq entry next-entry)))
+ (display-version (if-let
((next-version (hyperdrive-entry-version next-entry)))
+
(number-to-string next-version)
+ "latest")))
+ (concat ": " (propertize display-version 'face
'transient-value))))))
+ ("V p" "Previous" hyperdrive-previous-version
+ :inapt-if-not (lambda ()
+ (hyperdrive-entry-previous (oref transient--prefix
scope) :cache-only t))
+ ;; :transient t
+ :description (lambda ()
+ (if-let ((entry (oref transient--prefix scope))
+ (hyperdrive (hyperdrive-entry-hyperdrive entry)))
+ (concat "Previous"
+ (pcase-exhaustive (hyperdrive-entry-previous
entry :cache-only t)
+ ('unknown (concat ": " (propertize "?"
'face 'transient-value)))
+ ('nil nil)
+ ((cl-struct hyperdrive-entry version)
+ (concat ": " (propertize (number-to-string
version)
+ 'face
'transient-value)))))
+ "Previous")))]
[ ;; Current
:description
(lambda ()
@@ -124,51 +167,7 @@
("v" "View" hyperdrive-dir-view-file
:if (lambda ()
(when-let ((entry-at-point (hyperdrive-dir--entry-at-point)))
- (not (hyperdrive--entry-directory-p entry-at-point)))))]
- ["Version"
- :description (lambda ()
- (if-let ((entry (oref transient--prefix scope))
- (hyperdrive (hyperdrive-entry-hyperdrive entry)))
- (concat (propertize "Version: "
- 'face 'transient-heading)
- (propertize (format "%s"
- (or
(hyperdrive-entry-version entry)
- "latest"))
- 'face 'transient-value))
- "Version"))
- ("V h" "History" hyperdrive-history)
- ("V n" "Next" hyperdrive-next-version
- :inapt-if-not (lambda ()
- (let ((entry (oref transient--prefix scope)))
- (and (hyperdrive-entry-version entry)
- (hyperdrive-entry-next entry))))
- ;; :transient t
- :description (lambda ()
- (concat "Next"
- (when-let* ((entry (oref transient--prefix scope))
- (hyperdrive
(hyperdrive-entry-hyperdrive entry))
- (next-entry (hyperdrive-entry-next
entry))
- ;; Don't add ": latest" if we're
already at the latest version
- ((not (eq entry next-entry)))
- (display-version (if-let
((next-version (hyperdrive-entry-version next-entry)))
-
(number-to-string next-version)
- "latest")))
- (concat ": " (propertize display-version 'face
'transient-value))))))
- ("V p" "Previous" hyperdrive-previous-version
- :inapt-if-not (lambda ()
- (hyperdrive-entry-previous (oref transient--prefix
scope) :cache-only t))
- ;; :transient t
- :description (lambda ()
- (if-let ((entry (oref transient--prefix scope))
- (hyperdrive (hyperdrive-entry-hyperdrive entry)))
- (concat "Previous"
- (pcase-exhaustive (hyperdrive-entry-previous
entry :cache-only t)
- ('unknown (concat ": " (propertize "?"
'face 'transient-value)))
- ('nil nil)
- ((cl-struct hyperdrive-entry version)
- (concat ": " (propertize (number-to-string
version)
- 'face
'transient-value)))))
- "Previous")))]]
+ (not (hyperdrive--entry-directory-p entry-at-point)))))]]
[["Gateway"
("g s" "Start" hyperdrive-start)
("g S" "Stop" hyperdrive-stop)
@@ -220,7 +219,10 @@
('nil (propertize "none"
'face
'transient-inactive-value))
(it (propertize it
- 'face 'transient-value))))))]
+ 'face 'transient-value))))))
+ ("N" "New" hyperdrive-new)
+ ("d" "Describe" hyperdrive-describe-hyperdrive)
+ ("C-M-P" "Purge" hyperdrive-purge)]
(interactive (list (hyperdrive-complete-hyperdrive :force-prompt
current-prefix-arg)))
(transient-setup 'hyperdrive-menu-hyperdrive nil nil :scope hyperdrive))
- [nongnu] elpa/hyperdrive 44b2dffb76 081/123: Change: (-menu) Add bindings for copy-url and download-entry in file, (continued)
- [nongnu] elpa/hyperdrive 44b2dffb76 081/123: Change: (-menu) Add bindings for copy-url and download-entry in file, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 2ad1257377 106/123: Comment: Add TODO, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive ab49d76616 105/123: Change: (hyperdrive-menu-set-pet/nickname) Initial inputs, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 0d1f555750 115/123: Change: (hyperdrive-up) Take callback and use in transient, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 1d506efc90 099/123: Change: (hyperdrive-menu) Add :pad-keys t to "Selected" group, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 49d847b16c 112/123: Comment: Update TODO, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive dead3de763 117/123: Fix: (hyperdrive-delete) Add workaround for hypercore-fetch bug, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 85b19a47f3 113/123: Comment: Add FIXME, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 260da27dd6 104/123: Change: Use transient-show-help, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 3777a9eb21 092/123: Change: (hyperdrive-menu) Rename At point -> Selected, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 13aff2f505 094/123: Change: (hyperdrive-menu) Move version section,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive d138f92165 093/123: Change: (hyperdrive-menu-hyperdrive) Rename Drive -> Hyperdrive, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive cca8fa76cc 116/123: Comment: Remove FIXME, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 0c205cdb4c 114/123: Comment: Add TODO, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive f7d7cec5b0 097/123: Comment: Add TODO, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive f5013519c5 101/123: Change: Rearrange some commands, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 785ebe8edd 110/123: Fix: (hyperdrive-menu) Update next/prev between files/dirs, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive f83e955abc 108/123: Change: (hyperdrive-menu-set-pet/nickname) :transient t, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive ec3692c439 120/123: Change: (hyperdrive-menu) Add hyperdrive-delete, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 247afd42e4 090/123: Change: (hyperdrive-menu) Rename Info manual -> Help, ELPA Syncer, 2023/10/06
- [nongnu] elpa/hyperdrive 665e8f289c 016/123: WIP, ELPA Syncer, 2023/10/06