emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [RFC] Display most recent log item in Agenda


From: Eric Abrahamsen
Subject: Re: [O] [RFC] Display most recent log item in Agenda
Date: Wed, 17 Dec 2014 15:16:57 +0800
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Eric Abrahamsen <address@hidden> writes:
>
>> I thought that's what `org-log-beginning' was for: finding where the
>> log-note list would be (drawer or no), if it exists.
>
> Not exactly. It finds where the next note is to be inserted. This may
> not be in front of the log-note list even if it exists (e.g., if
> `org-log-states-order-reversed' is nil you may end up in front of the
> following paragraph).
>
>> If users aren't using `org-log-into-drawer', `org-log-beginning'
>> should still go to the spot where the list would be, right?
>
> Not necessarily. It actually doesn't look for such a list. It could end
> up after the list (see above) or even in a different location (see
> below).
>
> Also, it doesn't tell if there is a list at all, so if you rely on it,
> you need to double-check if you really are close to a log-note.

Well sure, I was already aware of all this (except I hadn't caught that
`org-log-beginning' would go to the intended location of the *newest
note*, not just the location of the list, thanks for that). There were
also some checks in the code I sent to make sure there was actually a
list in the spot where `org-log-beginning' deposited us.

> Unfortunately, recognizing a log note is impossible, since it is
> a regular plain list. Contents change, and templates are customizables
> (see `org-log-note-headings'). See, for example, the hack in
> `org-skip-over-state-notes'.

I'm not terribly worried about finding the real last state note with
100% accuracy -- as you say, that's not really possible. This would be a
convenience function displaying a useful bit of information, and if it
fails to do so no planes will crash. Anyone who cares enough to use it
probably already knows where their notes are. ("You've got to know where
your towel is.")

I'd be inclined just to go to the location of `org-log-beginning', look
around for likely log notes, show the most recent one if we can find
it, and bail if not. What do you think?

>> Then, if there's a list there, I take the first or last note (depending
>> on log-state-notes-reversed).
>>
>> I don't know why the notes would be scattered across the section...
>
> Because in this case, the list is not necessarily re-used. The first
> note is inserted after planning info and properties drawer. If, later,
> you insert some text before it, logging process will create a new list
> above, and so on. E.g.,
>
> Step 1:
>
>   * Headline
>     - Note 1
>
> Step 2:
>
>   * Headline
>     Some text
>     - Note 1
>
> Step 3:
>
>   * Headline
>     - Note 2
>     Some text
>     - Note 1
>
>
> Regards,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]