[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add org-after-note-stored-hook
From: |
Joris Caravati |
Subject: |
Re: [PATCH] Add org-after-note-stored-hook |
Date: |
Thu, 09 May 2024 10:20:40 +0200 |
Hello,
Is there anything wrong with the patch or with the proposition of
adding a hook there? The first I'd like to know for doing better next
time (or maybe correcting this one), the second to know if I should
stop using it.
Thanks!
Joris
Joris Caravati <tyx+org@sula.io> writes:
> 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
>
> [2. text/x-patch; 0001-Add-org-after-note-stored-hook.patch]...
- Re: [PATCH] Add org-after-note-stored-hook,
Joris Caravati <=