branch: elpa/hyperdrive commit 035b3bc5ac98306afb8f21d86b6000009d38dcb1 Author: Joseph Turner <jos...@ushin.org> Commit: Joseph Turner <jos...@ushin.org>
Change: (h/forget-file) Rename from h/clear-cache --- CHANGELOG.org | 4 ++-- hyperdrive-dir.el | 2 +- hyperdrive-menu.el | 2 +- hyperdrive.el | 19 +++++++++++-------- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 9783d8beb5..b98a26a2ba 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -28,8 +28,8 @@ installation with ~M-x hyperdrive-install~, and a faster directory UI! - When visiting an old version of a hyperdrive file, press ~n~ and ~p~ to traverse the version history. Press ~q~ to kill the current buffer. - View hyperdrive disk usage with ~hyperdrive-describe~ and ~hyperdrive-menu~. -- Clear local copy of a file or directory with ~hyperdrive-clear-cache~, - also bound in ~hyperdrive-menu~ and menu bar. +- Delete the local copy of a file or directory with + ~hyperdrive-forget-file~, also bound in ~hyperdrive-menu~ and menu bar. ** Changed diff --git a/hyperdrive-dir.el b/hyperdrive-dir.el index 93483bfaa3..b379422f6b 100644 --- a/hyperdrive-dir.el +++ b/hyperdrive-dir.el @@ -217,7 +217,7 @@ With point on header, returns directory entry." "d" #'h/download "^" #'h/up "D" #'h/delete - "C" #'h/clear-cache + "F" #'h/forget-file "H" #'h/dir-history "s" #'h/dir-sort "?" #'h/menu diff --git a/hyperdrive-menu.el b/hyperdrive-menu.el index c0ecb4b506..7a7164f95b 100644 --- a/hyperdrive-menu.el +++ b/hyperdrive-menu.el @@ -167,7 +167,7 @@ (or version (not (h/writablep hyperdrive)))))) ("d" "Download" h/download :if-not-mode h/dir-mode) - ("C" "Clear cache" h/clear-cache + ("F" "Forget file" h/forget-file :transient t)] ;; TODO: Consider adding a defcustom to hide the "Selected" and ;; "Current" groups when in a directory buffer. diff --git a/hyperdrive.el b/hyperdrive.el index 6253257ed5..65213e96e8 100644 --- a/hyperdrive.el +++ b/hyperdrive.el @@ -182,16 +182,19 @@ Interactively, prompt for hyperdrive and action." (propertize "safe" 'face 'success) (propertize "unsafe" 'face 'error)))))) -(defun h/clear-cache (entry) - "Clear local cache for file or directory ENTRY. -Only clears the cache for the file or directory at ENTRY's -version; other versions of the file or directory are not cleared." +(defun h/forget-file (entry) + "Delete local copy of the file or directory contents of ENTRY. +Only delete the blob(s) for the file or directory at ENTRY's +version; other versions of the file or directory are not cleared. +If ENTRY is a directory, recursively delete blobs for all files +within the directory. Hyperdrive directory contents are not +modified; file blobs may be recoverable from other peers." ;; TODO: Consider supporting an :all-versions key for clearing the cache for ;; all versions of the file/directory. (interactive (list (h//context-entry))) (when (yes-or-no-p (format-message - "Clear local copy of entry (data will likely not be recoverable—see manual): `%s'? " + "Clear local copy of entry (data may not be recoverable—see manual):`%s'? " (h//format-entry entry))) (let ((url (he/url entry))) (h/api 'post url @@ -1239,10 +1242,10 @@ The return value of this function is the retrieval buffer." (not (string= ".." (alist-get 'display-name (he/etc selected-entry)))))) :help "Delete file/directory at point"] - ["Clear Cache" (lambda () + ["Forget file" (lambda () (interactive) - (call-interactively #'h/clear-cache)) - :help "Clear local cache for file/directory at point"] + (call-interactively #'h/forget-file)) + :help "Delete local copy of file/directory contents at point"] ) ("Version" :label (let* ((version (he/version h/current-entry))