Joris Caravati writes: >> 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). Right. Yet, using a hook is still not ideal - what if you configure todo keywords to not store note at all in future? Then, the hook will never be executed or will be executed at the time you don't expect. Note-taking mechanisms is generally tricky - it is schedule-based, with note being taken after the current command is executed. I think I know how to make it possible for the note to be taken at the right place after subtree archival. May you try the attached patch?