Ihor Radchenko writes: > Although, removing heading from inside > `org-after-todo-state-change-hook' is a bad idea - Org mode does not > expect the heading to disappear from under the cursor when this hook is > executed. I recommend using `org-trigger-hook' instead. Thanks for your help! I switched to `org-trigger-hook' without issue. > An easier way would be forcing note earlier by calling > `org-add-log-note' from your hook. I remember trying that before adding the hook (and I tried again today) but the problem with adding the note directly is that I only seem to manage storing the note where the task was before being archived, eg. with this (or any variants I could think of while making sense of what note functions do): #+begin_src elisp (when (member (plist-get properties ':to) '("CANCELLED" "READ")) (org-add-log-note) (my/org-roam-archive-to-today)) #+end_src which I find logical, since `org-store-log-note' is only called after =C-c C-c= is pressed, whereas the archival function is called just after the note buffer is created. So I still struggle to see how I could do without the hook (maybe if the archival function would return the position of the task after moving it, but that seems more complicated than just using the hook). > It will probably be better to run such new hooks right before (message "Note stored") > in `org-store-log-note'. A patch modified to match the suggested location for the `run-hooks' is attached.