[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Add org-after-note-stored-hook
From: |
Joris Caravati |
Subject: |
[PATCH] Add org-after-note-stored-hook |
Date: |
Tue, 02 Jan 2024 23:13:06 +0100 |
User-agent: |
mu4e 1.10.8; emacs 29.1 |
Hello,
I've been archiving tasks automatically using
`org-after-todo-state-change-hook' but I've been recently bit with a
note (entering a todo state configured with '@') being placed where the
task was before its archival.
This patch aims to offer a way to defer the archival after the
note is stored. Actually, I am using it like this:
#+begin_src elisp
(add-to-list 'org-after-todo-state-change-hook
(lambda ()
;; States configured without mandatory note
(when (member org-state '("DONE"))
(my/org-roam-archive-to-today))
;; States configured with mandatory note
(when (member org-state '("CANCELLED" "READ"))
(add-to-list 'org-after-note-stored-hook
'my/org-roam-archive-to-today))))
#+end_src
With `my/org-roam-archive-to-today' removing itself from
`org-after-note-stored-hook'.
Hopefully I did not miss an existing way to do this.
Regards,
Joris
0001-Add-org-after-note-stored-hook.patch
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Add org-after-note-stored-hook,
Joris Caravati <=