emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [BUG] incorrect (and slow) indentation of logbook entries
Date: Sat, 18 Jul 2020 17:24:48 -0500	[thread overview]
Message-ID: <87blkcsbpr.fsf@fastmail.fm> (raw)
In-Reply-To: <87r1t8sdhd.fsf@fastmail.fm>

Matt Lundin <mdl@imapmail.org> writes:

> 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.

I did some more investigation and think the bug may lie deeper. The
commit above changed the functions used in org-fixup-indentation. Prior
to the commit org-fixup-indentation called org-indent-line on each line
within a LOGBOOK. Now it calls org-indent-region on the entire LOGBOOK.
So the problems seem to lie in org-indent-region.

To test this, I manually called org-indent-region on a region containing
a LOGBOOK. I saw the same indentation problems and slowness as I
reported in the previous email. Here are the profiling results from
calling org-indent-region on a LOGBOOK containing 303 lines (mix of
notes, clock drawers, state changes):

org-indent-region                                             303         20.374798015  0.0672435578
org-element-at-point                                          655         6.7059473859  0.0102380876
org-element--parse-to                                         654         6.6907969839  0.0102305764
org-element--current-element                                  36791       6.3040008640  0.0001713462
org-element--list-struct                                      3372        3.6317395729  0.0010770283
org--get-expected-indentation                                 355         3.00431385    0.0084628559
org-element-clock-parser                                      2738        0.7868292469  0.0002873737
org-element-item-parser                                       29700       0.7527248339  2.534...e-05
org-element-timestamp-parser                                  2738        0.7245477349  0.0002646266
org-parse-time-string                                         5476        0.6267072680  0.0001144461
org-element--collect-affiliated-keywords                      4026        0.2572965799  6.390...e-05
org-element-drawer-parser                                     654         0.1057650070  0.0001617201
org-element-plain-list-parser                                 3372        0.0736009140  2.182...e-05
org-get-limited-outline-regexp                                9063        0.0575772250  6.352...e-06
org-at-heading-p                                              8083        0.0267149439  3.305...e-06
org-element--cache-put                                        36791       0.0176797030  4.805...e-07
org-element-paragraph-parser                                  327         0.011128276   3.403...e-05


  reply	other threads:[~2020-07-18 22:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-18 21:46 [BUG] incorrect (and slow) indentation of logbook entries Matt Lundin
2020-07-18 22:24 ` Matt Lundin [this message]
2020-09-05 15:04 ` Bastien
2020-09-07  7:18   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blkcsbpr.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).