Slawomir Grochowski <[email protected]> writes:
> I noticed this while using Org notes as a lightweight diary. I keep
> inactive timestamps for days and add log notes under them. When I later
> look at what happened on a given day, I naturally read the notes from
> oldest to newest. This makes the insertion point chosen for new notes
> matter: new log notes should be inserted after the existing log notes,
> not before an older regular note.
I can see how this can be confusing. However, the existing behavior is
following the documentation of `org-log-states-order-reversed:
Non-nil means the latest state note will be directly after heading.
When nil, the state change notes will be ordered according to time.
That said, `org-store-log-note' also uses
`org-log-states-order-reversed' even for not for state change logs.
> Although the function name still mentions "state", there is precedent
> for treating plain log notes as state notes in this context. In a
> December 2023 list discussion, Ihor clarified that a plain note added via
> `org-add-note' does count here:
>
> https://mail.gnu.org/archive/html/emacs-orgmode/2023-12/msg00169.html
I think that's unrelated. We did not discuss ordering there, just the
log note format.
> This series follows that interpretation: the name is kept for
> compatibility, but the implementation is adjusted to skip the full log
> note list.
> ...
> The second patch is the actual fix. It makes
> `org-skip-over-state-notes' consider all non-empty formats from
> `org-log-note-headings'. It also teaches `%s' and `%S' in log note
> formats to match quoted inactive timestamps, e.g. "[2024-01-01 Mon]",
> which is needed for reschedule notes.
>
> Before this change, a regular note after a state note made the function
> stop early. The new test covers a state note, a regular note, and a
> reschedule note, and checks that point reaches the following paragraph.
>
> Feedback is welcome, especially on whether broadening
> `org-skip-over-state-notes' is the right way to reflect the existing
> interpretation.
I do not see any bug here.
The current behavior of is consistent with the docstring.
What you propose will be a small breaking change. Maybe it makes sense,
especially if we generalize `org-log-states-order-reversed' to apply to
all notes, not just state changes. But we may also consider leaving
`org-log-state-notes-insert-after-drawers' separate and introducing
another customization that will apply to other logs.
Also, note that the existence of
`org-log-state-notes-insert-after-drawers' means that state change notes
may be completely separated from the rest of the notes.
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>