From 3f73f871e60ab837e3b7aea363998ad5ee0ebdaa Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Mon, 20 Jun 2022 20:54:03 +0530 Subject: [PATCH] Fix incorrect key bug --- init.org | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/init.org b/init.org index 2b76f10..7f6917c 100644 --- a/init.org +++ b/init.org @@ -2330,25 +2330,26 @@ Only tracks for today's date are considered." (dir (concat "/media/data/phone/contrapunctus/Nokia 6.1/Android/data/net.osmand.plus/files/tracks/rec/" (format-time-string "%+4Y-%m/" day))) (dir-check (file-exists-p dir)) - (activity t) - (files (cl-loop for file in (directory-files dir) + (plists (cl-loop with activity + for file in (directory-files dir) when (and (string-match-p (format-time-string "^%F_" day) file) (or (and (string-match-p "(walk)" file) (setq activity :walking)) (and (string-match-p "(run)" file) (setq activity :running)))) - collect file)) - (plists (cl-loop for file in files collect - (with-current-buffer - (get-buffer-create (find-file-noselect (concat dir file))) - (append '(:name "Exercise") - `(,activity (,(floor (my-gpx-distance file)) . "meters")) - (my-get-gpx-timestamps)) - ;; (chronometrist-insert (chronometrist-active-backend)) - ))) + collect + (with-current-buffer + (get-buffer-create + (find-file-noselect (concat dir file))) + (append '(:name "Exercise") + `(,activity (,(floor (my-gpx-distance file)) . "meters")) + (my-get-gpx-timestamps)) + ;; (chronometrist-insert (chronometrist-active-backend)) + ))) (string (mapconcat (lambda (plist) - (format "%S" plist)) plists "\n"))) + (chronometrist-plist-pp plist)) + plists "\n"))) (progn (kill-new string) (message "Copied %s to kill ring" string)) (message "No suitable GPX files found")))