From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mI7gAs4712L0HAEAbAwnHQ (envelope-from ) for ; Wed, 20 Jul 2022 01:18:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QGD+Ac4712LZVwAAG6o9tA (envelope-from ) for ; Wed, 20 Jul 2022 01:18:38 +0200 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 E80D416A15 for ; Wed, 20 Jul 2022 01:18:36 +0200 (CEST) Received: from localhost ([::1]:53074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDwU8-0002ll-4b for larch@yhetil.org; Tue, 19 Jul 2022 19:18:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDwTT-0002lZ-TT for emacs-orgmode@gnu.org; Tue, 19 Jul 2022 19:17:55 -0400 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]:37552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDwTS-0001Z8-49; Tue, 19 Jul 2022 19:17:55 -0400 Received: by mail-yb1-xb36.google.com with SMTP id 75so29310854ybf.4; Tue, 19 Jul 2022 16:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jtv3a7Zfn5Q6Hy6ae2MzvWw2xooQX51KiNGRw+R84E0=; b=MMWYkv4vKqWGtfvWQPxWt2X1mUhzP4TjmdXTurS9obQOK8rirvRxSYg8msbWhMiFhr yP1SVbkeqYdeIhtOX0T5+jHPct4YM8W45PAMDk+Adk9oj88UEd07/73rX2oY6jbh4sGQ EyXa4yAkzhO9FFqMa2U0u7GBryvEnZ+cgV5I3aHh/zMcAAW3mmJka5viXyhXxtLESwtT h7Wqqq44DVADUB63Qe7iJh8TTc4N3mCSmxDObfoShAZwSP2ZOnSXJuzLDQ1xsQUvhHV2 bwpP6/zwMSXCW17I+uPNChmopyk5ccEHTuHoO5N3C+CKIEZ29z+oo0SaafWNo/R68RK5 E5aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jtv3a7Zfn5Q6Hy6ae2MzvWw2xooQX51KiNGRw+R84E0=; b=yOihegKWD9R3oct300Vc9DuUKLgePYntZYHV0hlpF7XEIAHlTCf6KoEbDbo4LkW4yl nCIyVHoX9nTSRELaJl8t9rA2YBA6JvP6w7ySLub03r7w40PPTVq2LPCGMThTnj2kio+E TqYHGbZ7q6oNKNldRvGdp5IZpsjCgWm1SdRV10pilGqTE1EemffdBbn3Ll4n7kCcO3Aa gZDypjl7raZAS4e5220SBIWQeWPUr/c5KIDTjQ2yAswLnldzo/gtSikndnM6CdkTGJbB amhDQTW2o+8Dd0E7Em4gBkkfPMdJ5FRAj29MyB+Boo4aSnqQ66CPNUCwX8Y+HJi4E7Q1 BJPA== X-Gm-Message-State: AJIora8rgLdMrry1ZkUhiz2UhhtJo3bDw8CBScuSQ7/VbWuwrARAP8To ROm4/4HRpacj+3cd/E3ciNSwEu3lEW4tMmV7l94wtlGIt5Nl0w== X-Google-Smtp-Source: AGRyM1u3jdO1HSVm5LlbQc75BZ4uEMERFydHsf0V/VYfqbakwCTz5CcZyYmuQUDSjg7F5bqVvXjHBRu6CMGMpWqeNqc= X-Received: by 2002:a25:f501:0:b0:670:82db:18d2 with SMTP id a1-20020a25f501000000b0067082db18d2mr4863265ybe.212.1658272672154; Tue, 19 Jul 2022 16:17:52 -0700 (PDT) MIME-Version: 1.0 References: <9F4AA657-D34B-4B85-A80D-1DD4B3017DB2@gmail.com> <87mtd542uv.fsf@localhost> In-Reply-To: <87mtd542uv.fsf@localhost> From: Mamoru Miura Date: Wed, 20 Jul 2022 08:17:40 +0900 Message-ID: Subject: Re: Bug: Appointments duration and effort sums in agenda column view [9.3.7 (release_9.3.7-700-ga1e5be @ ~/.emacs.d/straight/build/org/)] To: Ihor Radchenko Cc: bzg@gnu.org, emacs-orgmode@gnu.org, s.vlasov@uvt.nl Content-Type: multipart/mixed; boundary="00000000000090e73c05e430b141" Received-SPF: pass client-ip=2607:f8b0:4864:20::b36; envelope-from=mamo3gr@gmail.com; helo=mail-yb1-xb36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658272717; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jtv3a7Zfn5Q6Hy6ae2MzvWw2xooQX51KiNGRw+R84E0=; b=i1o2dxJlWRORz6TLERHdnVw1nwqduJtm1qRvMmoriBy6PX1VkVlwcyow0urUTyR2Nxbe08 dNThMjHaR7Bs9KHtLqasKYdoXIilmBU8m2vcuO3/B06V6loJimbSRFyk+M7BAxUbydxB5C 1riSXifkR7VL8oyOOyPFJ7SR0XM9cBRVsRTP8MfVv/NzQvnsBAoCeOmkm9xBr12SynCm24 oyZyT2G5KGC8MTzcPlhxs6bU6t+xsN2zN6cqLHt713i0CtKGynKFomRnEahGIgYTHfktpe /W00X0Lquuhyo67UqqJtd9lJ8d65SUnecP3AzOn3lcsI0uTzZTuEmUfr3uU4PQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658272717; a=rsa-sha256; cv=none; b=FJ4xu4mvKf9ZZK8b3o5gsRvxIMKOvezlO+6Kranqzgpo2wKNN5Ggs+qAkLdgMA/6Zj2nMT 7H8kb+ALWzcpV455sS/aUU+5i03lxYt+0mWIG8ug0YOphdVek4v8KM851aaPGQ8GPIEf/2 WhEosJ7Lce9itdqI1QDbpozpyV16AnKGItMsWtv6k+GdnTucjGimZpC632bNCbaHz4hxB0 3vc3D578JhC0Gut3iov9pJBYkqbNNMjVNKhwnZx+XL6676aiR9k3aHE7X8QZp0cx0/ozPb 4cuQX3iB+KzEVZHf1lQRmrMfd9j9Xo5hwDN22aaBsBV0E40ZUvwXpOIOeb6YmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MMWYkv4v; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.93 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MMWYkv4v; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E80D416A15 X-Spam-Score: -3.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: vqAhWV5zpFn4 --00000000000090e73c05e430b141 Content-Type: text/plain; charset="UTF-8" Dear Ihor, Thank you for responding. The issue is failing to collect (and sum) appointments' duration as effort even when `org-agenda-columns-add-appointments-to-effort-sum' is t. My environment: * Emacs 28.1 * Org 9.5.4 Here's the setting (~/.emacs.d/init.el): (setq org-directory "~/org/") (setq org-agenda-files (list org-directory)) (setq org-columns-default-format "%Item %Effort{:}") (setq org-agenda-columns-add-appointments-to-effort-sum t) With putting org-file (~/org/test.org): * My appointment SCHEDULED: <2022-07-20 Wed 10:00-11:00> * My appointment with effort SCHEDULED: <2022-07-20 Wed 11:00-12:00> :PROPERTIES: :Effort: 0:30 :END: Steps to see this issue: 1. run M-x org-agenda 2. type "a" to show "agenda for current week or day" 3. run M-x org-agenda-columns (C-c C-x C-c) Then, you see that the column "Effort" for the item "My appointment" is empty and not added to the daily effort summation. Bug investigation and solving approach: * The function `org-columns--collect-values' collects appointment duration: https://github.com/bzg/org-mode/blob/e0b05b07528dea684f3439c017370436b8d37b50/lisp/org-colview.el#L291 * With running M-x describe-text-properties on the item "My appointment" in the *Org Agenda* buffer, it has a text property "duration" and its value is correct (60.0). Given these facts, the property "duration" seems to disappear somewhere or the function fails to collect it. (Unfortunately, I didn't have the room to deep dive into further details.) * To solve this, instead of collecting value, get the corresponding item (entry) and recompute the duration from it. I found a computing function `org-agenda-format-item' and re-use it. I re-attach a patch because the previous patch contains a bug. See also (insightful reports by Stanislav): * https://emacs.stackexchange.com/questions/58875/how-do-i-add-appointments-to-effort-sum * https://lists.gnu.org/archive/html/emacs-orgmode/2020-08/msg00090.html Kind regards, Mamoru --00000000000090e73c05e430b141 Content-Type: application/octet-stream; name="0001-lisp-org-colview.el-Fix-missing-addition-of-appointm.patch" Content-Disposition: attachment; filename="0001-lisp-org-colview.el-Fix-missing-addition-of-appointm.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l5ssfsi10 RnJvbSBiZmRiOTZiMDY0NmVhYzIxNzRkM2FjNjMyOTg2ZTk3ZTQ1NzExMjI1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNYW1vcnUgTWl1cmEgPG1hbW8zZ3JAZ21haWwuY29tPgpEYXRl OiBXZWQsIDIwIEp1bCAyMDIyIDA3OjA2OjMyICswOTAwClN1YmplY3Q6IFtQQVRDSF0gbGlzcC9v cmctY29sdmlldy5lbDogRml4IG1pc3NpbmcgYWRkaXRpb24gb2YgYXBwb2ludG1lbnRzIHRvCiBl ZmZvcnQKCiogbGlzcC9vcmctY29sdmlldy5lbCAob3JnLWNvbHVtbnMtLWNvbGxlY3QtdmFsdWVz KTogcmUtY29tcHV0ZQphcHBvaW50bWVudHMnIGR1cmF0aW9uIGJlY2F1c2UgdGhpcyBmdW50aW9u IGNhbiBub3QgZ2V0IHRleHQgcHJvcGVydHkKYCdkdXJhdGlvbicuCgpUSU5ZQ0hBTkdFCi0tLQog bGlzcC9vcmctY29sdmlldy5lbCB8IDcgKysrLS0tLQogMSBmaWxlIGNoYW5nZWQsIDMgaW5zZXJ0 aW9ucygrKSwgNCBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNwL29yZy1jb2x2aWV3LmVs IGIvbGlzcC9vcmctY29sdmlldy5lbAppbmRleCAxMzY0MzEwMWIuLmVhZTA5ZTA5NiAxMDA2NDQK LS0tIGEvbGlzcC9vcmctY29sdmlldy5l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