5

Following Rainer König's example in this video, I've customized org-log-into-drawer to be LOGBOOK. I've also added timestamps for various state changes such as from DOING to DONE, so that when these events happen, entries are added to the :LOGBOOK: drawer. I'm also using org-add-note to add notes unrelated to state changes.

The problem with this approach is that the notes are intermingled with the state change entries. For example:

** DONE set up date-based plan files :LOGBOOK: - State "DONE" from "DOING" [2017-09-13 Wed 15:18] - Note taken on [2017-09-13 Wed 15:07] \\ To add a timestamp, do ~C-c !~ (for inactive ones anyway) in insert mode. - State "DOING" from "NEXT" [2017-09-13 Wed 14:25] CLOCK: [2017-09-13 Wed 14:22]--[2017-09-13 Wed 15:00] => 0:38 - State "NEXT" from "TODO" [2017-09-12 Tue 15:45] :END:

It's not easy to visually pick out the notes (which are often more relevant) from the state change events and clock events.

So my question is: can I separate the notes from the other information? I'd prefer for notes to go into their own :NOTES: drawer, but I'd also accept an answer that added notes to the body of the headline, outside of a drawer.

(Note: I'm aware of this question, but as far as I can tell it controls the notes and other entries together, without distinction, so it won't suffice for my purposes.)

2
  • I am setting up emacs following Rainer König's videos as well, and I had the same doubt as you. I see your question has been posted quite some time ago. Have you found any solution to this? Sep 30, 2021 at 1:02
  • No! Although I am tolerating it without pain and even forgot I asked this question. Oct 1, 2021 at 15:04

1 Answer 1

0

I did it like this:

(defun salih/toggle-logbook-on (&rest _)
  (setq org-log-into-drawer t))
(defun salih/toggle-stats-on (&rest _)
  (setq org-log-into-drawer "STATS"))

(advice-add 'org-clock-in :before #'salih/toggle-logbook-on)
(advice-add 'org-clock-in :after #'salih/toggle-stats-on)

(advice-add 'org-agenda-add-note :before #'salih/toggle-stats-on)
(advice-add 'org-agenda-add-note :after #'salih/toggle-logbook-on)

This will separate the "CLOCK"s into LOGBOOK and everything else into "STATS"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.