aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-05 04:56:56 -0500
committerCraig Jennings <c@cjennings.net>2026-05-05 04:56:56 -0500
commitd8fd744b0669c6a4b3fb08fb4d75ab421c3a0416 (patch)
treee3f458b36a6d8385f962494d13333601c33e5e15
parent5108e05eeb395f1d66122c25c862b1401478853f (diff)
downloadchime-d8fd744b0669c6a4b3fb08fb4d75ab421c3a0416.tar.gz
chime-d8fd744b0669c6a4b3fb08fb4d75ab421c3a0416.zip
refactor: rewrite chime--time-left without threading-pcase
Edebug's defun parser rejects the `(-> seconds (pcase ...) ...)' form, so undercover can't instrument chime.el and `make coverage' produces nothing. The let-bound rewrite is equivalent and parses cleanly. I left an inline note so the form doesn't get folded back later.
-rw-r--r--chime.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/chime.el b/chime.el
index 046a094..93f72b1 100644
--- a/chime.el
+++ b/chime.el
@@ -686,13 +686,15 @@ Returns non-nil only if the timestamp includes HH:MM time information."
"Human-friendly representation for SECONDS.
Format is controlled by `chime-time-left-format-at-event',
`chime-time-left-format-short', and `chime-time-left-format-long'."
- (-> seconds
- (pcase
- ((pred (>= 0)) chime-time-left-format-at-event)
- ((pred (>= 3600)) chime-time-left-format-short)
- (_ chime-time-left-format-long))
-
- (format-seconds seconds)))
+ ;; Don't fold this into a `(-> seconds (pcase ...) ...)' threading form —
+ ;; edebug's defun parser rejects threaded pcase, which breaks coverage
+ ;; instrumentation (undercover) on this file.
+ (let ((format-string
+ (pcase seconds
+ ((pred (>= 0)) chime-time-left-format-at-event)
+ ((pred (>= 3600)) chime-time-left-format-short)
+ (_ chime-time-left-format-long))))
+ (format-seconds format-string seconds)))
(defun chime--get-hh-mm-from-org-time-string (time-string)
"Convert given org time-string TIME-STRING into string with \\='hh:mm\\=' format."