emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] incorrect (and slow) indentation of logbook entries
@ 2020-07-18 21:46 Matt Lundin
  2020-07-18 22:24 ` Matt Lundin
  2020-09-05 15:04 ` Bastien
  0 siblings, 2 replies; 4+ messages in thread
From: Matt Lundin @ 2020-07-18 21:46 UTC (permalink / raw)
  To: Org Mode List

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-07  7:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-18 21:46 [BUG] incorrect (and slow) indentation of logbook entries Matt Lundin
2020-07-18 22:24 ` Matt Lundin
2020-09-05 15:04 ` Bastien
2020-09-07  7:18   ` Bastien

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).