From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2EznB91tE1+8CQAA0tVLHw (envelope-from ) for ; Sat, 18 Jul 2020 21:47:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sB0BBN1tE1+bJgAA1q6Kng (envelope-from ) for ; Sat, 18 Jul 2020 21:47:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BB018940390 for ; Sat, 18 Jul 2020 21:47:07 +0000 (UTC) Received: from localhost ([::1]:35260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwufi-0003ZD-9h for larch@yhetil.org; Sat, 18 Jul 2020 17:47:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwufL-0003Z5-MK for emacs-orgmode@gnu.org; Sat, 18 Jul 2020 17:46:43 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:46631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwufJ-0001FZ-Nn for emacs-orgmode@gnu.org; Sat, 18 Jul 2020 17:46:43 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D0D455C0067; Sat, 18 Jul 2020 17:46:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 18 Jul 2020 17:46:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imapmail.org; h= from:to:subject:date:message-id:mime-version:content-type; s= fm3; bh=52JDe3NwVa407fDxcpWFr6OTxl7iWY4KFQ5dY+xu3Hw=; b=e18zjaj/ TF/2s/YPtAuUA5FiC+KOcxptAiL207l53NJNko0/y+J2bak4HqsTRV8lycqh8Tle QujGPhZhfnDDolhbQfSkTr++pVGVYrHVJsb/KtKLHSn7A4+k8bhNvcZx9A4IVilA CjveelxsUXJEX2fk2MXDiIc9TLn42HEK4wUWNxZFC4Z+HpP1kO8iqeCEukKXXvtU 5TSfDoJ724WgoIlL9eyFZWXLNB1doCMOcsLpWJqvXAGOXjRkgUR4Nzo6GT+iYG+J VMhVE1BFOKnYqXOjX0eJM8Q80mZuMEUsFQZNN5beM+BJIM2RR3y5jDlM+a91pN/G Qu9R8L2iu+simg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=52JDe3NwVa407fDxcpWFr6OTxl7iW Y4KFQ5dY+xu3Hw=; b=bpVF5gI7Vny6xElQSZTOI/RotXxa39oGAAJJGMRY+9mXG wuBOCyDdpDr1pUzYEfuzaCjcIegicaRs39+LedDIndF90cpzkhPTRNH4hfQsfn3B qRft76vusOh0Ri87GBxPI3tSXLyfG0TX80ZkUsONTogczSgajcRQk1xwG0G7YdiR tI4uRQ3TbtDAX692cYYMU1Ykcc2/123KoxZey26kARCnZ3RsXkFGr7fp+0TUW7Ri DA+1dMDYd/YoJYvetBsjfMg9ZR+KkQXYqRjb+GL8gh2nTyaxyJ3MKcwoQX6nQ/OF hzxPVwyT1TFEbl+L9hu0rzWDr33316RJcynHQcDAQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrgedtgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkgggtsehttdertddttddtnecuhfhrohhmpeforghtthcunfhunhgu ihhnuceomhgulhesihhmrghpmhgrihhlrdhorhhgqeenucggtffrrghtthgvrhhnpeehke dvudfhledvgfekhfffteetudfgudfftedtgeeghfdujefhjefghfejgedtieenucffohhm rghinhepshgvtghonhgushdrohhrghenucfkphepjeeirdduiedrudefhedrudduleenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmughlsehi mhgrphhmrghilhdrohhrgh X-ME-Proxy: Received: from localhost (c-76-16-135-119.hsd1.il.comcast.net [76.16.135.119]) by mail.messagingengine.com (Postfix) with ESMTPA id 83CF130600A6 for ; Sat, 18 Jul 2020 17:46:39 -0400 (EDT) From: Matt Lundin To: Org Mode List Subject: [BUG] incorrect (and slow) indentation of logbook entries Date: Sat, 18 Jul 2020 16:46:38 -0500 Message-ID: <87r1t8sdhd.fsf@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.25; envelope-from=mdl@imapmail.org; helo=out1-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/18 17:46:39 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=imapmail.org header.s=fm3 header.b=e18zjaj/; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=bpVF5gI7; dmarc=pass (policy=none) header.from=imapmail.org; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: fTclU6ivQwpR 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