[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive d7ad2d87e2 02/13: Change: (hyperdrive-mirror) A
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive d7ad2d87e2 02/13: Change: (hyperdrive-mirror) Add faces for each status |
Date: |
Fri, 8 Sep 2023 19:00:08 -0400 (EDT) |
branch: elpa/hyperdrive
commit d7ad2d87e240d29ec1c205899798dd31da2b870e
Author: Joseph Turner <joseph@ushin.org>
Commit: Adam Porter <adam@alphapapa.net>
Change: (hyperdrive-mirror) Add faces for each status
This requires using string-match-p to match status since the string is
padded with whitespace.
---
hyperdrive-mirror.el | 38 ++++++++++++++++++++++----------------
hyperdrive-vars.el | 12 ++++++++++++
2 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/hyperdrive-mirror.el b/hyperdrive-mirror.el
index dcc54da5fa..a4f63355bf 100644
--- a/hyperdrive-mirror.el
+++ b/hyperdrive-mirror.el
@@ -49,7 +49,7 @@ uploading files, open PARENT-ENTRY."
(let* ((count 0)
(upload-files-and-urls (cl-remove-if (pcase-lambda (`(,_id [,status
,_file ,_url]))
;; Exclude files which have
not been changed.
- (equal status "same"))
+ (string-match-p "same" status))
files-and-urls))
(progress-reporter
(make-progress-reporter (format "Uploading %s files: " (length
upload-files-and-urls)) 0 (length upload-files-and-urls)))
@@ -140,21 +140,27 @@ predicate and set NO-CONFIRM to t."
:hyperdrive hyperdrive
:path (expand-file-name (file-relative-name
file source) target-dir)
:encode t))
- (status (condition-case err
- (if (time-less-p
(hyperdrive-entry-modified (hyperdrive-fill entry :then 'sync))
-
(file-attribute-modification-time (file-attributes file)))
- ;; TODO: Propertize status strings.
- "changed"
- "same")
- (plz-error
- (pcase (caddr err)
- ((app plz-error-response (cl-struct
plz-response (status 404) body))
- ;; Entry doesn't exist: Set `status'
to `new'.
-
(hyperdrive-update-nonexistent-version-range entry)
- "new")
- (_
- ;; Re-signal error.
- (signal (car err) (cdr err)))))))
+ (status-no-properties
+ (condition-case err
+ (if (time-less-p (hyperdrive-entry-modified
(hyperdrive-fill entry :then 'sync))
+
(file-attribute-modification-time (file-attributes file)))
+ "changed"
+ "same")
+ (plz-error
+ (pcase (caddr err)
+ ((app plz-error-response (cl-struct
plz-response (status 404) body))
+ ;; Entry doesn't exist: Set `status' to
`new'.
+ (hyperdrive-update-nonexistent-version-range
entry)
+ "new")
+ (_
+ ;; Re-signal error.
+ (signal (car err) (cdr err)))))))
+ (status
+ (propertize (format "%-7s" status-no-properties)
+ 'face (pcase-exhaustive
status-no-properties
+ ("new" 'hyperdrive-mirror-new)
+ ("changed"
'hyperdrive-mirror-changed)
+ ("same"
'hyperdrive-mirror-same))))
(url (hyperdrive-entry-url entry)))
(list url (vector status file url))))
files)))
diff --git a/hyperdrive-vars.el b/hyperdrive-vars.el
index 4cf376c1ef..9c12b85be8 100644
--- a/hyperdrive-vars.el
+++ b/hyperdrive-vars.el
@@ -218,6 +218,18 @@ an existing buffer at the same version, or make a new
buffer."
(defface hyperdrive-history-unknown '((t (:foreground "black" :background
"yellow")))
"Marker for entries with unknown existence in `hyperdrive-history' buffers.")
+(defface hyperdrive-mirror-new '((t (:foreground "black" :background "green")))
+ "Face for files with \"new\" status in `hyperdrive-mirror' buffers."
+ :group 'hyperdrive-faces)
+
+(defface hyperdrive-mirror-same '((t (:foreground "black" :background "red")))
+ "Face for files with \"same\" status in `hyperdrive-mirror' buffers."
+ :group 'hyperdrive-faces)
+
+(defface hyperdrive-mirror-changed '((t (:foreground "black" :background
"yellow")))
+ "Face for files with \"changed\" status in `hyperdrive-mirror' buffers."
+ :group 'hyperdrive-faces)
+
(defface hyperdrive-button
;; Inspired by cus-edit.el's `custom-button' face.
;; NOTE: This face is not currently used, but
- [nongnu] elpa/hyperdrive updated (b5651bcfd1 -> 24df174711), ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive d7ad2d87e2 02/13: Change: (hyperdrive-mirror) Add faces for each status,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 96326a0222 06/13: Fix: (hyperdrive--mirror) Signal user-error when no files to upload, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive bc622823e6 10/13: Tidy: Function call, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive 4a6296f10f 09/13: Comment: Add NOTE, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive 1423b9b8f2 08/13: Comment: Add TODO, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive 0d6ad70c0c 03/13: Add: (hyperdrive-mirror.el) Add revert-buffer-function, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive 2ce5f9c3a9 01/13: Change: (hyperdrive-mirror.el) Compare file modification times, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive 39475924c0 04/13: Change: (hyperdrive-mirror) Distinguish older files from same mtime, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive 0591645ed8 05/13: Comment: Add TODO, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive a71bea29a8 07/13: Comment: Update TODO, ELPA Syncer, 2023/09/08
- [nongnu] elpa/hyperdrive be7dc28786 11/13: Tidy: (hyperdrive-next-version) Use if instead of pcase, ELPA Syncer, 2023/09/08