[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive aa29fa3652 06/14: Add: (hyperdrive-history-view
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive aa29fa3652 06/14: Add: (hyperdrive-history-view-file) View file from history mode |
Date: |
Wed, 6 Sep 2023 04:00:03 -0400 (EDT) |
branch: elpa/hyperdrive
commit aa29fa3652bb0514091a9e2b03a2c592f2cc5017
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Add: (hyperdrive-history-view-file) View file from history mode
---
hyperdrive-history.el | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/hyperdrive-history.el b/hyperdrive-history.el
index 08372a033f..27a04e2d38 100644
--- a/hyperdrive-history.el
+++ b/hyperdrive-history.el
@@ -119,6 +119,7 @@ and ENTRY's version are nil."
:parent hyperdrive-ewoc-mode-map
:doc "Local keymap for `hyperdrive-history-mode' buffers."
"RET" #'hyperdrive-history-find-file
+ "v" #'hyperdrive-history-view-file
"=" #'hyperdrive-history-diff
"w" #'hyperdrive-history-copy-url
"d" #'hyperdrive-history-download-file)
@@ -263,6 +264,28 @@ buffer."
;; TODO: Design options
(hyperdrive-message "File not known to exist. What do you want to do?"))))
+(declare-function hyperdrive-view-file "hyperdrive")
+(defun hyperdrive-history-view-file (range-entry)
+ "Open hyperdrive entry in RANGE-ENTRY at point in `view-mode'.
+When entry does not exist or is not known to exist, does nothing
+and returns nil.
+
+Interactively, visit entry at point in `hyperdrive-history'
+buffer."
+ (declare (modes hyperdrive-history-mode))
+ (interactive (list (hyperdrive-history-range-entry-at-point)))
+ (pcase-exhaustive (hyperdrive-range-entry-exists-p range-entry)
+ ('t
+ ;; Known to exist: open it.
+ (hyperdrive-view-file (cdr range-entry)))
+ ('nil
+ ;; Known to not exist: warn user.
+ (hyperdrive-user-error "File does not exist!"))
+ ('unknown
+ ;; Not known to exist: prompt user
+ ;; TODO: Design options
+ (hyperdrive-message "File not known to exist. What do you want to do?"))))
+
(declare-function hyperdrive-copy-url "hyperdrive")
(defun hyperdrive-history-copy-url (range-entry)
- [nongnu] elpa/hyperdrive dff584bbe9 08/14: Meta: Update changelog, (continued)
- [nongnu] elpa/hyperdrive dff584bbe9 08/14: Meta: Update changelog, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 465e8a1aca 10/14: Comment: Explanation, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 109452e780 09/14: Merge branch 'view-file', ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 006dcb9261 12/14: Meta: Update changelog, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 466cbdd551 01/14: Comment: Remove TODO, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 38e110b99f 02/14: Change: (hyperdrive-open) Add createp flag, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive ab00310b84 03/14: Fix: Describe return values in docstrings, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive a000cfb8ff 13/14: Comment: Explanation, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive f9e2623048 05/14: Add: (hyperdrive-dir-view-file) View file from hyperdrive-dir-mode, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 55494532f3 07/14: Docs: Document hyperdrive-view-file and dir/history wrappers, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive aa29fa3652 06/14: Add: (hyperdrive-history-view-file) View file from history mode,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive f30fe3d890 11/14: Add: kill-buffer-query-functions integration, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive e85bd37f52 14/14: Fix: (-entry-version-ranges-no-gaps) Handle unknown entries, ELPA Syncer, 2023/09/06