emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] incorrect (and slow) indentation of logbook entries


From: Matt Lundin
Subject: [BUG] incorrect (and slow) indentation of logbook entries
Date: Sat, 18 Jul 2020 16:46:38 -0500

Commit e3b79ad2bf7ab7b91c0ad2b8383d639bfe154ce7 from Feb. 9, 2020 (Allow
a new value for `org-adapt-indentation') introduced a bug that causes
logbooks to be incorrectly indented when promoting an entry. As a
result, there are also significant slowdowns when promoting and demoting
an entry with hundreds of logbook entries.

For instance, when running org-promote-subtree on an entry with 300+
entries, elp-profiling showed that org-indent-region is called 305 times
for a total of 29.4 seconds.

org-indent-region        305         29.465412747  0.0966079106

By contrast, prior to the above commit (e3b79ad) org-promote-subtree
calls org-indent-region only 2 times on the same subtree:

org-indent-region        2           0.00690256    0.00345128

I haven't included the full logbook here for obvious reasons. But to
reproduce the indentation bug, promote the following entry with
org-promote-subtree:

--8<---------------cut here---------------start------------->8---
** TODO Do this
   SCHEDULED: <2020-07-18 Sat .+1d>
   :PROPERTIES:
   :LAST_REPEAT: [2020-07-18 Sat 11:14]
   :END:
   :LOGBOOK:
   - State "DONE"       from "TODO"       [2020-07-17 Fri 23:59]
   - State "DONE"       from "NOW"        [2020-07-16 Thu 10:19]
   CLOCK: [2020-07-16 Thu 09:22]--[2020-07-16 Thu 10:19] =>  0:57
   - State "DONE"       from "NOW"        [2020-07-13 Mon 15:11]
   CLOCK: [2020-07-13 Mon 14:52]--[2020-07-13 Mon 15:11] =>  0:19
   - State "DONE"       from "NOW"        [2020-07-12 Sun 14:44]
   CLOCK: [2020-07-12 Sun 14:09]--[2020-07-12 Sun 14:44] =>  0:35
   - State "DONE"       from "TODO"       [2020-07-10 Fri 16:07]
   - State "DONE"       from "NOW"        [2020-07-07 Tue 13:30]
   CLOCK: [2020-07-07 Tue 13:21]--[2020-07-07 Tue 13:30] =>  0:09
   - State "DONE"       from "NOW"        [2020-07-06 Mon 09:32]
   :END:
--8<---------------cut here---------------end--------------->8---

After calling org-promote-subtree, notice that the first CLOCK entry and
all subsequent entries are incorrectly indented:

--8<---------------cut here---------------start------------->8---
* TODO Do this
  SCHEDULED: <2020-07-18 Sat .+1d>
  :PROPERTIES:
  :LAST_REPEAT: [2020-07-18 Sat 11:14]
  :END:
  :LOGBOOK:
  - State "DONE"       from "TODO"       [2020-07-17 Fri 23:59]
  - State "DONE"       from "NOW"        [2020-07-16 Thu 10:19]
    CLOCK: [2020-07-16 Thu 09:22]--[2020-07-16 Thu 10:19] =>  0:57
    - State "DONE"       from "NOW"        [2020-07-13 Mon 15:11]
    CLOCK: [2020-07-13 Mon 14:52]--[2020-07-13 Mon 15:11] =>  0:19
    - State "DONE"       from "NOW"        [2020-07-12 Sun 14:44]
    CLOCK: [2020-07-12 Sun 14:09]--[2020-07-12 Sun 14:44] =>  0:35
    - State "DONE"       from "TODO"       [2020-07-10 Fri 16:07]
    - State "DONE"       from "NOW"        [2020-07-07 Tue 13:30]
    CLOCK: [2020-07-07 Tue 13:21]--[2020-07-07 Tue 13:30] =>  0:09
    - State "DONE"       from "NOW"        [2020-07-06 Mon 09:32]
  :END:
--8<---------------cut here---------------end--------------->8---

Best,

Matt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]