branch: elpa/hyperdrive commit 78e8eda8e915e2dc56893236263fcf672b596870 Author: Joseph Turner <jos...@ushin.org> Commit: Joseph Turner <jos...@ushin.org>
Change: (he/fill) Rename from h/fill --- hyperdrive-history.el | 4 ++-- hyperdrive-lib.el | 10 +++++----- hyperdrive-mirror.el | 2 +- hyperdrive.el | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hyperdrive-history.el b/hyperdrive-history.el index 928011a246..744ea88e86 100644 --- a/hyperdrive-history.el +++ b/hyperdrive-history.el @@ -202,7 +202,7 @@ prefix argument \\[universal-argument], prompt for ENTRY." (with-silent-modifications (h/history-mode) (setq-local h/history-current-entry entry) - (setf ewoc h/ewoc) ; Bind this for the h/fill lambda. + (setf ewoc h/ewoc) ; Bind this for the he/fill lambda. (ewoc-filter h/ewoc #'ignore) (erase-buffer) (ewoc-set-hf h/ewoc header "") @@ -234,7 +234,7 @@ prefix argument \\[universal-argument], prompt for ENTRY." (mapc (lambda (range-entry) (when (eq t (h/range-entry-exists-p range-entry)) ;; TODO: Handle failures? - (h/fill (cdr range-entry) :queue queue :then #'ignore))) + (he/fill (cdr range-entry) :queue queue :then #'ignore))) range-entries) (set-buffer-modified-p nil) (goto-char (point-min))))) diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el index a5af890baf..882388d67b 100644 --- a/hyperdrive-lib.el +++ b/hyperdrive-lib.el @@ -497,7 +497,7 @@ When VERSION is nil, return latest version of ENTRY." (setf (he/version entry) version) (condition-case err ;; FIXME: Requests to out of range version currently hang. - (h/fill entry) + (he/fill entry) (plz-error (pcase (plz-response-status (plz-error-response (caddr err))) ;; FIXME: If plz-error is a curl-error, this block will fail. @@ -583,7 +583,7 @@ echo area when the request for the file is made." ;; FIXME: Some of the synchronous filling functions we've added now cause this to be blocking, ;; which is very noticeable when a file can't be loaded from the gateway and eventually times out. (let ((hyperdrive (he/hyperdrive entry))) - (h/fill entry + (he/fill entry :then (lambda (entry) (pcase-let* (((cl-struct hyperdrive-entry type) entry) (handler (alist-get type h/type-handlers @@ -651,7 +651,7 @@ echo area when the request for the file is made." (when messagep (h/message "Opening <%s>..." (he/url entry))))) -(cl-defun h/fill (entry &key queue (then 'sync) else) +(cl-defun he/fill (entry &key queue (then 'sync) else) "Fill ENTRY's metadata and call THEN. If THEN is `sync', return the filled entry and ignore ELSE. Otherwise, make request asynchronously and call THEN with the @@ -671,7 +671,7 @@ the given `plz-queue'" ;; (e.g. if the user reverted too quickly). nil) (_ - (h/message "hyperdrive-fill: error: %S" plz-error)))))) + (h/message "hyperdrive-entry-fill: error: %S" plz-error)))))) (pcase then ('sync (condition-case err (h//fill entry (plz-response-headers @@ -991,7 +991,7 @@ HYPERDRIVE's public metadata file." ;; NOTE: Don't attempt to fill hyperdrive struct with old metadata :version nil)) (metadata (condition-case err - ;; TODO: Refactor to use :as 'response-with-buffer and call h/fill + ;; TODO: Refactor to use :as 'response-with-buffer and call he/fill (pcase-let (((cl-struct plz-response headers body) (he/api 'get entry :noquery t))) diff --git a/hyperdrive-mirror.el b/hyperdrive-mirror.el index 324db6b5a0..1dbd3ae93c 100644 --- a/hyperdrive-mirror.el +++ b/hyperdrive-mirror.el @@ -157,7 +157,7 @@ been checked." (let ((entry (he/create :hyperdrive hyperdrive :path (expand-file-name (file-relative-name file source) target-dir)))) - (h/fill entry :queue metadata-queue + (he/fill entry :queue metadata-queue :then (lambda (entry) (let* ((drive-mtime (floor (float-time (he/mtime entry)))) (local-mtime (floor (float-time (file-attribute-modification-time (file-attributes file))))) diff --git a/hyperdrive.el b/hyperdrive.el index 8648114d53..d2e42a96cf 100644 --- a/hyperdrive.el +++ b/hyperdrive.el @@ -474,7 +474,7 @@ in a directory. Otherwise, or with universal prefix argument ;; TODO: If plz adds support for getting response headers when downloading ;; as a file (<https://github.com/alphapapa/plz.el/issues/61>), use it here. ;; Filling entry is necessary in order to update hyperdrive disk-usage. - (h/fill (h/url-entry url)))) + (he/fill (h/url-entry url)))) ;;;###autoload (defun hyperdrive-write-buffer (entry &optional overwritep)