From ae8041b7ffa753ceabddafdf8c04b04c69ad454b Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Thu, 21 Nov 2024 09:13:50 -0500 Subject: [PATCH] FIX clock thingy --- local/lib/org-x/org-x.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/local/lib/org-x/org-x.el b/local/lib/org-x/org-x.el index b4e49c2..f75d147 100644 --- a/local/lib/org-x/org-x.el +++ b/local/lib/org-x/org-x.el @@ -1883,13 +1883,14 @@ ARG, ask for a range in minutes in place of the second date." (let* ((t1 (read-date nil)) (t2 (if (equal arg '(4)) (read-duration t1) (read-date t1)))) (if (< t2 t1) (message "Second timestamp earlier than first!") - (let ((s (org-ml-unixtime-to-time-long t1)) - (e (org-ml-unixtime-to-time-long t2))) + (let ((s (org-ml-unixtime-to-timelist t t1)) + (e (org-ml-unixtime-to-timelist t t2))) (org-ml-update-this-headline* (org-ml-headline-map-logbook-clocks* (org-x-logbook-config) - (let ((new-clock (org-ml-build-clock! s :end e))) - (if (org-ml-clock-is-running (car it)) - `(,(car it) ,new-clock ,@(cdr it)) + (let ((new-clock (org-ml-build-clock! s :end e)) + (first-clock (car it))) + (if (and first-clock (org-ml-clock-is-running first-clock)) + `(,first-clock ,new-clock ,@(cdr it)) (cons new-clock it))) it)))))))