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

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

[nongnu] elpa/hyperdrive d888a2d1c3 04/14: Add: (hyperdrive-view-file) O


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive d888a2d1c3 04/14: Add: (hyperdrive-view-file) Open hyperdrive file in view-mode
Date: Wed, 6 Sep 2023 04:00:02 -0400 (EDT)

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

    Add: (hyperdrive-view-file) Open hyperdrive file in view-mode
---
 hyperdrive.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hyperdrive.el b/hyperdrive.el
index 214b2e9594..4aa808f79b 100644
--- a/hyperdrive.el
+++ b/hyperdrive.el
@@ -349,6 +349,18 @@ for more information.  See `hyperdrive-read-entry' and
   (interactive (list (hyperdrive-read-entry :force-prompt current-prefix-arg)))
   (hyperdrive-open entry))
 
+;;;###autoload
+(defun hyperdrive-view-file (entry)
+  "View ENTRY in `view-mode', returning to previous buffer when done.
+Interactively, prompts for known hyperdrive and path.
+
+With universal prefix argument \\[universal-argument], prompts
+for more information.  See `hyperdrive-read-entry' and
+`hyperdrive-complete-hyperdrive'."
+  (interactive (list (hyperdrive-read-entry :force-prompt current-prefix-arg)))
+  (hyperdrive-open entry
+    :createp nil :then (lambda () (view-buffer (current-buffer)))))
+
 ;;;###autoload
 (defun hyperdrive-open-url (url)
   "Open hyperdrive URL."



reply via email to

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