Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > Hello, > > Eric Abrahamsen <e...@ericabrahamsen.net> writes: > >> Right now it looks like the central "cond" statement in >> `org-add-log-setup' is as close as we've got to a canonical definition >> of where a heading's log list is to be found. Should I just write my own >> version of this, or would you be open to refactoring `org-add-log-setup' >> so the "finding" part is a separate function that can be reused >> elsewhere? > > Done, as `org-log-beginning'. Note that it will return a non-nil value > even if there is no log list in the entry.
I was just fooling with this a bit, and am noticing some odd (to me) behavior. If I start with emacs -Q, then (goto-char (org-log-beginning)) takes me to the start of a :LOGBOOK: drawer, and (org-element-at-point) returns the drawer. That works no matter whether the log drawer is folded or not. But if the headline is folded, (org-element-at-point) returns the headline. Starting emacs with my usual customizations, it's even weirder than that. If I start with the subtree visible but the log drawer folded, then this (starting with point in the middle of the headline): (progn (goto-char (org-log-beginning)) (org-element-at-point)) Gives me paragraph. But eval'ing the two lines above consecutively (without the progn), gives me the drawer. If the logbook drawer is unfolded, I get paragraph every time. Anyway, I don't know what the expected behavior is, and I don't know how outline visibility is supposed to impact document parsing. But this seems strange... All I've customized is: (setq org-log-into-drawer t) Thanks, eric