fix: make iteration through records generic

This commit is contained in:
contrapunctus 2021-11-06 15:34:39 +05:30
parent 96aa0f86ea
commit 0c9aaffd9f
1 changed files with 6 additions and 2 deletions

View File

@ -801,6 +801,9 @@ Return nil (and run `magit-status') if the user answers no."
#+END_SRC
**** after-project-stop
FIXME -
1. instead of changing the last plist, change the last plist with name "OSM" and without tags or key-values (because a new plist may have been inserted in the meantime)
#+BEGIN_SRC emacs-lisp
(use-package request)
(use-package esxml-query)
@ -815,10 +818,10 @@ Return nil (and run `magit-status') if the user answers no."
(defun my-get-saved-changeset-id (backend)
(-let* (((&plist :changesets saved-changesets)
(chronometrist-loop-records for plist in backend
(cl-loop for plist in
;; the very latest OSM plist is the one we just created -
;; we want the one before that
initially do (backward-list)
(rest (chronometrist-to-list backend))
when (and (equal "OSM" (plist-get plist :name))
;; ignore plists without a :changesets keyword
(plist-get plist :changesets))
@ -855,6 +858,7 @@ Return nil (and run `magit-status') if the user answers no."
(new-plist (chronometrist-plist-update
(chronometrist-latest-record (chronometrist-active-backend))
`(:changesets ,new-changesets))))
;; (message "Last changeset ID - %s" last-id)
(chronometrist-replace-last (chronometrist-active-backend) new-plist)))
(defun my-save-osm-changeset-details ()