emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-orgmode@gnu.org
Subject: Re: [RFC] Display most recent log item in Agenda
Date: Wed, 17 Dec 2014 15:16:57 +0800	[thread overview]
Message-ID: <874msuoidy.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87k31s559y.fsf@nicolasgoaziou.fr

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> 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	other threads:[~2014-12-17  7:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-14 10:07 [RFC] Display most recent log item in Agenda Eric Abrahamsen
2014-12-14 15:12 ` Eric Abrahamsen
2014-12-14 20:34 ` Nicolas Goaziou
2014-12-15  1:34   ` Eric Abrahamsen
2014-12-15 12:43     ` Nicolas Goaziou
2014-12-16  2:26       ` Eric Abrahamsen
2014-12-16  9:10         ` Nicolas Goaziou
2014-12-17  7:16           ` Eric Abrahamsen [this message]
2014-12-20 21:13             ` Nicolas Goaziou
2014-12-19  8:50           ` Eric Abrahamsen
2014-12-20 21:02             ` Nicolas Goaziou
2014-12-21  4:08               ` Eric Abrahamsen
2014-12-15  4:29   ` Eric Abrahamsen
2014-12-15 12:33     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874msuoidy.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).