[chronometrist] extend display-key-values

This commit is contained in:
contrapunctus 2021-07-09 21:30:19 +05:30
parent a4517fdd58
commit 150764aa2e
1 changed files with 13 additions and 4 deletions

View File

@ -625,16 +625,21 @@ Return nil (and run `magit-status') if the user answers no."
:movement movement))
plist)
(catalog-name (cond (opus "Op.") (bwv "BWV ") (t "")))
(catalog (format "(%s%s)" catalog-name (or opus bwv)))
(catalog (if (or opus bwv)
(format "(%s%s)" catalog-name (or opus bwv))))
(movement (cond ((not movement) "")
((chronometrist-plist-pp-alist-p movement)
(contrapunctus-objects-to-string ", " " - " (mapcar #'cdr movement)))
(t (format "- %s" (cdr movement))))))
(contrapunctus-objects-to-string " " name catalog movement)))
("Cooking"
(-let (((&plist :recipe (&plist :name name)) plist)
((&plist :recipe recipe) plist))
recipe))
(let ((recipe (plist-get plist :recipe)))
(cond ((null recipe) "")
((chronometrist-plist-p recipe)
(plist-get recipe :name))
((listp recipe)
(contrapunctus-objects-to-string ", " recipe))
(t recipe))))
("Video editing"
(-let [(&plist :episode ep) plist]
(contrapunctus-objects-to-string " " "episode" ep)))
@ -655,9 +660,13 @@ Return nil (and run `magit-status') if the user answers no."
collect (format "%s %s" (car elt) (cdr elt))
else collect (format "%s" elt)))))
(concat key-string (contrapunctus-objects-to-string ", " content-string))))
("Reading"
(-let [(&plist :play play :book book) plist]
(or play book)))
(_ "Task not implemented"))))
#+END_SRC
**** key-values
#+BEGIN_SRC emacs-lisp
(use-package chronometrist-key-values