Idea for event handlers in Org mode

This commit is contained in:
Bram Schoenmakers 2022-11-26 08:09:02 +01:00
parent bcdd0157b7
commit 74f10827ff
2 changed files with 33 additions and 0 deletions

View file

@ -79,6 +79,26 @@ Put this in ~/.termux/termux.properties for a better Emacs experience inside Ter
| 2022-11-26 | 140 |
#+end_src
** Idea: event handlers :idea:
Have =ON_<STATE>= properties containing code that evaluates when that state is reached. Can be looked up and evaluated from =org-after-todo-state-change-hook=.
#+begin_src org :tangle gists/org-event-handlers.org
,* TODO Update metric
:PROPERTIES:
:ON_DONE: (org-babel-execute-subtree)
:END:
,#+begin_src elisp :results table append
(with-temp-buffer
(insert-file-contents user-init-file)
(list (format-time-string "%F") (count-matches "(use-package ")))
,#+end_src
,#+RESULTS:
| 2022-11-26 | 140 |
#+end_src
* vertico-repeat setup :emacs:vertico:
My vertico-repeat setup.

View file

@ -0,0 +1,13 @@
* TODO Update metric
:PROPERTIES:
:ON_DONE: (org-babel-execute-subtree)
:END:
#+begin_src elisp :results table append
(with-temp-buffer
(insert-file-contents user-init-file)
(list (format-time-string "%F") (count-matches "(use-package ")))
#+end_src
#+RESULTS:
| 2022-11-26 | 140 |