1

I just learned about the following org-mode option, which ensures newly entered timestamps end up in the LOGBOOK drawer:

(setq org-log-into-drawer t)

How can I automatically move existing timestamps (which so far have been logged outside of the drawer) so that they all end up inside the drawer?

As an example, how to quickly go from:

** TODO Important task
SCHEDULED: <2018-04-23 Mon .+7d>
- State "DONE"       from "TODO"       [2018-04-09 Mon 14:05]
CLOCK: [2018-04-09 Mon 14:02]--[2018-04-09 Mon 14:05] =>  0:03
- State "DONE"       from "TODO"       [2018-03-26 Mon 09:21]
- State "DONE"       from "TODO"       [2018-03-19 Mon 13:15]
CLOCK: [2018-03-19 Mon 13:09]--[2018-03-19 Mon 13:15] =>  0:06
- State "DONE"       from "TODO"       [2018-03-01 Thu 12:39]
CLOCK: [2018-02-26 Mon 08:43]--[2018-02-26 Mon 08:56] =>  0:13
- State "DONE"       from "TODO"       [2018-01-18 Thu 08:20]
- State "DONE"       from "TODO"       [2017-11-13 mån 14:07]
CLOCK: [2017-11-13 mån 14:06]--[2017-11-13 mån 14:07] =>  0:01
- State "DONE"       from "TODO"       [2017-10-23 mån 17:55]
CLOCK: [2017-10-23 mån 10:08]--[2017-10-23 mån 10:11] =>  0:03
- State "DONE"       from "TODO"       [2017-10-02 mån 10:46]
CLOCK: [2017-10-02 mån 10:44]--[2017-10-02 mån 10:46] =>  0:02

To something like:

** TODO Important task
SCHEDULED: <2018-04-23 Mon .+7d>
:LOGBOOK:
CLOCK: [2018-04-09 Mon 14:02]--[2018-04-09 Mon 14:05] =>  0:03
CLOCK: [2018-03-19 Mon 13:09]--[2018-03-19 Mon 13:15] =>  0:06
CLOCK: [2018-02-26 Mon 08:43]--[2018-02-26 Mon 08:56] =>  0:13
CLOCK: [2017-11-13 mån 14:06]--[2017-11-13 mån 14:07] =>  0:01
CLOCK: [2017-10-23 mån 10:08]--[2017-10-23 mån 10:11] =>  0:03
CLOCK: [2017-10-02 mån 10:44]--[2017-10-02 mån 10:46] =>  0:02
:END:
- State "DONE"       from "TODO"       [2017-10-23 mån 17:55]
- State "DONE"       from "TODO"       [2017-10-02 mån 10:46]
[...]
  • Please provide a specific example of where your time-stamp(s) is/are that you want to move, and which drawer you wish to target (e.g., LOGBOOK), and what should happen if there are two times-tamps; e.g., DEADLINE and SCHEDULED. Some people put time-stamps in a heading, and some people put time-stamps in the notes section. So, as you see, including the drawer, there are at least five possible locations. – lawlist Apr 19 '18 at 15:23
  • Good point. I updated my question. – Roberto Aloi Apr 20 '18 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.