From d8fd744b0669c6a4b3fb08fb4d75ab421c3a0416 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 04:56:56 -0500 Subject: 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. --- chime.el | 16 +++++++++------- 1 file 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." -- cgit v1.2.3