[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive 509f72b4f0 02/49: Change: (hyperdrive-history)
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive 509f72b4f0 02/49: Change: (hyperdrive-history) Display history buffer immediately |
Date: |
Wed, 20 Sep 2023 19:01:30 -0400 (EDT) |
branch: elpa/hyperdrive
commit 509f72b4f0ef685cedec9c354253b52bced42e58
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Change: (hyperdrive-history) Display history buffer immediately
Previously, this function called hyperdrive-fill-version-ranges before
displaying the buffer. Now, the history buffer is displayed
immediately to the user.
---
hyperdrive-history.el | 135 ++++++++++++++++++++++++--------------------------
1 file changed, 66 insertions(+), 69 deletions(-)
diff --git a/hyperdrive-history.el b/hyperdrive-history.el
index 160e631a23..c1a62f4e54 100644
--- a/hyperdrive-history.el
+++ b/hyperdrive-history.el
@@ -149,75 +149,72 @@ Universal prefix argument \\[universal-argument] forces
hyperdrive-current-entry)))
;; TODO: Highlight range for ENTRY
(when (hyperdrive--entry-directory-p entry)
- (hyperdrive-user-error "Directory history not yet implemented"))
- (hyperdrive-fill-version-ranges entry :then
- (lambda ()
- (pcase-let* (((cl-struct hyperdrive-entry hyperdrive path) entry)
- (range-entries
- (mapcar (lambda (range)
- ;; Some entries may not exist at
- ;; `range-start', as in the version before
- ;; it was created. See manual:
- ;; [[info:hyperdrive-manual.info#Versioning]]
- (cons range
- (hyperdrive-entry-create
- :hyperdrive hyperdrive
- :path path
- ;; Set version to range-start
- :version (car range))))
- ;; Display in reverse chronological order
- (nreverse (hyperdrive-entry-version-ranges-no-gaps
entry))))
- (main-header (hyperdrive-entry-description entry
:with-version nil))
- (header (concat main-header "\n"
- (format "%7s %13s %6s %s"
- (propertize "Exists?" 'face
'hyperdrive-column-header)
- (propertize "Version Range" 'face
'hyperdrive-column-header)
- (propertize "Size" 'face
'hyperdrive-column-header)
- (format (format "%%%ds"
hyperdrive-timestamp-width)
- (propertize "Last Modified"
'face 'hyperdrive-column-header)))))
- (queue) (ewoc))
- (with-current-buffer (get-buffer-create
- (format "*Hyperdrive-history: %s %s*"
- (hyperdrive--format-host hyperdrive
:format hyperdrive-default-host-format
- :with-label t)
- (url-unhex-string path)))
- (with-silent-modifications
- (hyperdrive-history-mode)
- (setq-local hyperdrive-current-entry entry)
- (setf ewoc hyperdrive-ewoc) ; Bind this for the hyperdrive-fill
lambda.
- (ewoc-filter hyperdrive-ewoc #'ignore)
- (erase-buffer)
- (ewoc-set-hf hyperdrive-ewoc header "")
- (mapc (lambda (range-entry)
- (ewoc-enter-last hyperdrive-ewoc range-entry))
- range-entries))
- ;; TODO: Display files in pop-up window, like magit-diff buffers
appear when selected from magit-log
- (display-buffer (current-buffer)
hyperdrive-history-display-buffer-action)
- (setf queue (make-plz-queue :limit hyperdrive-queue-size
- :finally (lambda ()
- ;; NOTE: Ensure that the
buffer's window is selected,
- ;; if it has one.
(Workaround a possible bug in EWOC.)
- (if-let ((buffer-window
(get-buffer-window (ewoc-buffer ewoc))))
- (with-selected-window
buffer-window
- ;; TODO: Use
`ewoc-invalidate' on individual entries
- ;; (maybe later, as
performance comes to matter more).
-
(with-silent-modifications (ewoc-refresh hyperdrive-ewoc))
- (goto-char (point-min)))
- (with-current-buffer
(ewoc-buffer ewoc)
-
(with-silent-modifications (ewoc-refresh hyperdrive-ewoc))
- (goto-char (point-min))))
- ;; TODO: Accept then argument?
- ;; (with-current-buffer
(ewoc-buffer ewoc)
- ;; (when then
- ;; (funcall then)))
- )))
- (mapc (lambda (range-entry)
- (when (eq t (hyperdrive-range-entry-exists-p range-entry))
- ;; TODO: Handle failures?
- (hyperdrive-fill (cdr range-entry) :queue queue :then
#'ignore)))
- range-entries)
- (set-buffer-modified-p nil)
- (goto-char (point-min)))))))
+ (hyperdrive-user-error "Directory history not implemented."))
+ (pcase-let* (((cl-struct hyperdrive-entry hyperdrive path) entry)
+ (range-entries
+ (mapcar (lambda (range)
+ ;; Some entries may not exist at `range-start',
+ ;; as in the version before it was created, see:
+ ;; (info "(hyperdrive)Versioning")
+ (cons range
+ (hyperdrive-entry-create
+ :hyperdrive hyperdrive
+ :path path
+ ;; Set version to range-start
+ :version (car range))))
+ ;; Display in reverse chronological order
+ (nreverse (hyperdrive-entry-version-ranges-no-gaps
entry))))
+ (main-header (hyperdrive-entry-description entry :with-version
nil))
+ (header (concat main-header "\n"
+ (format "%7s %13s %6s %s"
+ (propertize "Exists?" 'face
'hyperdrive-column-header)
+ (propertize "Version Range" 'face
'hyperdrive-column-header)
+ (propertize "Size" 'face
'hyperdrive-column-header)
+ (format (format "%%%ds"
hyperdrive-timestamp-width)
+ (propertize "Last Modified"
'face 'hyperdrive-column-header)))))
+ (queue) (ewoc))
+ (with-current-buffer (get-buffer-create
+ (format "*Hyperdrive-history: %s %s*"
+ (hyperdrive--format-host hyperdrive :format
hyperdrive-default-host-format
+ :with-label t)
+ (url-unhex-string path)))
+ (with-silent-modifications
+ (hyperdrive-history-mode)
+ (setq-local hyperdrive-current-entry entry)
+ (setf ewoc hyperdrive-ewoc) ; Bind this for the hyperdrive-fill lambda.
+ (ewoc-filter hyperdrive-ewoc #'ignore)
+ (erase-buffer)
+ (ewoc-set-hf hyperdrive-ewoc header "")
+ (mapc (lambda (range-entry)
+ (ewoc-enter-last hyperdrive-ewoc range-entry))
+ range-entries))
+ ;; TODO: Display files in pop-up window, like magit-diff buffers appear
when selected from magit-log
+ (display-buffer (current-buffer)
hyperdrive-history-display-buffer-action)
+ (setf queue (make-plz-queue :limit hyperdrive-queue-size
+ :finally (lambda ()
+ ;; NOTE: Ensure that the buffer's
window is selected,
+ ;; if it has one. (Workaround a
possible bug in EWOC.)
+ (if-let ((buffer-window
(get-buffer-window (ewoc-buffer ewoc))))
+ (with-selected-window
buffer-window
+ ;; TODO: Use
`ewoc-invalidate' on individual entries
+ ;; (maybe later, as
performance comes to matter more).
+ (with-silent-modifications
(ewoc-refresh hyperdrive-ewoc))
+ (goto-char (point-min)))
+ (with-current-buffer
(ewoc-buffer ewoc)
+ (with-silent-modifications
(ewoc-refresh hyperdrive-ewoc))
+ (goto-char (point-min))))
+ ;; TODO: Accept then argument?
+ ;; (with-current-buffer
(ewoc-buffer ewoc)
+ ;; (when then
+ ;; (funcall then)))
+ )))
+ (mapc (lambda (range-entry)
+ (when (eq t (hyperdrive-range-entry-exists-p range-entry))
+ ;; TODO: Handle failures?
+ (hyperdrive-fill (cdr range-entry) :queue queue :then
#'ignore)))
+ range-entries)
+ (set-buffer-modified-p nil)
+ (goto-char (point-min)))))
(declare-function hyperdrive-diff-file-entries "hyperdrive-diff")
(defun hyperdrive-history-diff (old-entry new-entry)
- [nongnu] elpa/hyperdrive 1cfdeaea1f 15/49: Change: (hyperdrive-fill-version-ranges) let-bind limit at the top, (continued)
- [nongnu] elpa/hyperdrive 1cfdeaea1f 15/49: Change: (hyperdrive-fill-version-ranges) let-bind limit at the top, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 15a9b0ff56 17/49: Tidy: Remove message statements, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 8f9887407f 18/49: Tidy: (hyperdrive-fill-version-ranges) Use ignore, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 3ea4e934db 24/49: Change: (hyperdrive-open) Use hyperdrive-message, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 395d1dd5e0 25/49: Fix: (-fill-version-ranges) Stop filling when loop returns early, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 8dc8f09a82 30/49: Comment: Add TODO, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 77186465d7 33/49: WIP: Fixes, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 1844b57f51 39/49: Fix: (-update-nonexistent-version-range) Add default finally, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 44413406c9 40/49: Change: (-history-fill-version-ranges) Add loading indicator, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive e2ddaa770c 01/49: Change: (hyperdrive-fill-version-ranges) Only recurse from ENTRY, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 509f72b4f0 02/49: Change: (hyperdrive-history) Display history buffer immediately,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive d93ab84313 06/49: Meta: Update changelog, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 32580aaa6c 07/49: Docs: Document hyperdrive-fill-version-ranges-limit, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive f2474f65f0 08/49: Change: (-fill-version-ranges) In ELSE, send parallel requests, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 063c2275d1 09/49: WIP: (-fill-version-ranges) Fill existent and nonexistent ranges, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 73cef39917 12/49: WIP: Fix off-by-one, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 05a0421bbb 16/49: Change: (hyperdrive-fill-version-ranges) Use finishedp flag, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive cb91f4adac 03/49: Add: (-history-fill-version-ranges) Interactively fill versions, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 2c8a76234d 20/49: Tidy: (-fill-version-ranges) Rename queue to fill-entry-queue, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 830904c5cf 22/49: Comment: Remove TODO, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 92a54cb93c 23/49: Fix: (hyperdrive-update-nonexistent-version-range) Docstring, ELPA Syncer, 2023/09/20