gists/gists/track-use-package-over-time.org

27 lines
1.1 KiB
Org Mode
Raw Normal View History

* TODO Update Emacs package count
2022-12-04 10:01:35 +00:00
DEADLINE: <2023-01-04 Wed .+1m>
2022-11-26 06:58:45 +00:00
:PROPERTIES:
2022-12-04 10:01:35 +00:00
:LAST_REPEAT: [2022-12-04 Sun 10:56]
:ON_DONE: (org-babel-execute-subtree)
2022-11-26 06:58:45 +00:00
:END:
:LOGBOOK:
- State "DONE" from "TODO" [2022-11-26 Sat 07:57]
:END:
2022-12-04 10:01:35 +00:00
A small org file to keep track of some metric in a table, see [[https://orgmode.org/manual/Results-of-Evaluation.html][Results of Evaluation]] in the Org mode manual for more information. It's important that the function is supposed to return a list in order to record the result as a table row.
In this case, count the number of packages in my Emacs init file. It is executed automatically when the task is marked as done, using [[https://apps.bram85.nl/gitea/bram/gists/src/branch/main/gists/evaluate-code-on-task-state-change.org][this function]].
Press =C-c C-c= inside the code block to add a new entry to the table below.
#+begin_src elisp :results table append
(with-temp-buffer
(insert-file-contents user-init-file)
2022-12-04 10:02:02 +00:00
(list (format-time-string "%F")
(count-matches (rx (seq "(" (? "elpaca-") "use-package" space)))))
#+end_src
#+RESULTS:
| 2022-11-25 | 140 |
2022-11-26 06:58:45 +00:00
| 2022-11-26 | 140 |