From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] Display most recent log item in Agenda Date: Tue, 16 Dec 2014 10:10:33 +0100 Message-ID: <87k31s559y.fsf@nicolasgoaziou.fr> References: <87388imto5.fsf@ericabrahamsen.net> <878uia6kdh.fsf@nicolasgoaziou.fr> <87ppbllmqj.fsf@ericabrahamsen.net> <87vbld5biw.fsf@nicolasgoaziou.fr> <87wq5sqqin.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0o8a-00063l-Fr for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 04:09:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0o8P-0007pH-Ft for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 04:09:45 -0500 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:44556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0o8P-0007pD-9c for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 04:09:37 -0500 In-Reply-To: <87wq5sqqin.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 16 Dec 2014 10:26:08 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Abrahamsen Cc: emacs-orgmode@gnu.org Eric Abrahamsen 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. 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'. > 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,