From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id aInAIO7w+WZBLQAA62LTzQ:P1 (envelope-from ) for ; Mon, 30 Sep 2024 00:29:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id aInAIO7w+WZBLQAA62LTzQ (envelope-from ) for ; Mon, 30 Sep 2024 02:29:34 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BQF2ZZzW; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727656174; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=ztlQL8NKZ9EeJO2NEdj91ISjM4xj8/5j045rWYwIzf8=; b=N4y99r9rObeqZkV+oxmOTZCiHkXYIJ/jt9PI0l7vtsK6INAyrQ6RYkHOTn00dcJDQe811+ tLxrU8ohvF9Xf8pqV48l9sN5VebzkJJjUtzG81btLAVwg+M/UNSzAFoQUKoKDWz7nmM6ZM n2RjShIxbQJ+r08cqB0I075IOkdfImH49wN8gZz5Sp569PDE0dEn9wLDTIeQNGkTi3UnLs NOod/FSb0XL+chXDOfe9s7D+FVeOzpM2XPkYpk7DetIlG8OHwed3lHUk1GQCNfRth4RJES tV7ME50rF70sq7FA4a71ETCEWYRR4qSfsC8A1D+aIVyWYr3htd9wqes7OmuJfg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BQF2ZZzW; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727656174; a=rsa-sha256; cv=none; b=iGFpruYwUvxzVxc+HbPZTQDjmvbRpPwIn83p/UoPVbsUclZJmIro/ZHrIAtwf9aVmFTjjz it6Bz3Lwy+Rm6BPCsGhotREOBJfXm0xuqB05AFioFRJYW+JO1KNOaqN7uRFFQXpPPLbb0p XRbtwYF+KS8J+gbmTbVoP83scYo0XjZV2cb6sy0xQli47/cqeSQMukB1Oq0a2/SU1wanua hLBKvakpZozvBSmmRwuDh4W0+9lKm+cJtry+NOiEAgURKT8W/t9djJ1dGze1xNYUTdeJsy CkwkENStZyl5dMRebyl6gkSJQaig13k/kqaX7RE7oLlvENgGPxpN1BLsw0pHFQ== 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 0D13B6459 for ; Mon, 30 Sep 2024 02:29:33 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sv4HF-0005GZ-9Q; Sun, 29 Sep 2024 20:28:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sv4HD-0005G8-37 for emacs-orgmode@gnu.org; Sun, 29 Sep 2024 20:28:35 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sv4HB-0007W7-6t for emacs-orgmode@gnu.org; Sun, 29 Sep 2024 20:28:34 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-7e6ed072cdaso646681a12.0 for ; Sun, 29 Sep 2024 17:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727656111; x=1728260911; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=ztlQL8NKZ9EeJO2NEdj91ISjM4xj8/5j045rWYwIzf8=; b=BQF2ZZzWLCPvX7/xDHpBbt16rQvl2KChvJJHcF+Bo+cFH4+5jE25b07YrgiHq3cSC9 d33/gmhBbReSChJD/n+oIi1sFoBRnnkPOlu3uUJhUSEROCa2dk0JMR9OV192n4Reeplz NEIbpr3GqIrUaYvWhmH1q8bYOP1tgWnAqT30km9UghI2CrZrkS8sadSH/XZYfbfI7FeU 6bqJJ2Uae3M0tgSSn+1KsJ7Div56dSPJzd6sBz6mOKAOAAfYw50Fb4O5cMzU+9DqGKRv foA5onPqsb+9rieWMnB1ohQC9wVujJJbAEOsk9H0HAbUPHy93eQ+sJE64tsu+ds+u/2L BEmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727656111; x=1728260911; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ztlQL8NKZ9EeJO2NEdj91ISjM4xj8/5j045rWYwIzf8=; b=ALucHeSzQE9He0o4e0DJcNiuvTabV93H74COGhwKOkEQg7Mja1IS/DzvmUqQHs6f06 8+88Dc9WGXAJkBBKMMacw+aF8ZKE+40RP1uEsvd6yTrvYpUrXIzltUNHYLwaE6WJ7Trh o/Y1RRA+phtIIb5S/JyMn++FR9oOAf4Ko6VNVi8k313hr6LgAk6KnrAAwvLGsvcoDQ4g As4mHkx8cuk+ZyLf9Vnqb57pPgSI5HC2tIn4Sl6JsfFnKgmxeFdNKPTBhnzRffRNaMJe WaCrC+9D6ba2duhUxwiICThnbPMAb3oaq55A+kEmk39a6IQCP/VHyYDhC9gumcn1Pc0N 1oMA== X-Gm-Message-State: AOJu0YyCEOvH3ABGxJv4Zc3/zvslFDzLOj80cJ5C6GSfHCXLcvG4JXRW akgaPMv7BSb81tR1mX3ORNQ+tUC9iVcBkExGbTS/k1uX2lyFeNhnbVzBgA== X-Google-Smtp-Source: AGHT+IEi5/9fsEbAUJdkrQpNrsrGz6VAM9tEXRL7JLz0bPjN7z6ALfYHdFUfEWOrECn2qbXvxX5VSA== X-Received: by 2002:a17:90b:118c:b0:2e0:a77e:8305 with SMTP id 98e67ed59e1d1-2e0b8ec75d7mr10886736a91.39.1727656111029; Sun, 29 Sep 2024 17:28:31 -0700 (PDT) Received: from tippah (tippah.anu.edu.au. [150.203.32.218]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e115344e79sm1790538a91.53.2024.09.29.17.28.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 17:28:30 -0700 (PDT) From: Anand Deopurkar To: emacs-orgmode Subject: Re: [PATCH] lisp/org-colview.el: Fix for adding appointments to effort sum In-Reply-To: <87y13ij6nx.fsf@gmail.com> (Anand Deopurkar's message of "Tue, 24 Sep 2024 09:23:46 +1000") References: <87y13ij6nx.fsf@gmail.com> Date: Mon, 30 Sep 2024 10:25:10 +1000 Message-ID: <87a5fqxa1l.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=anandrdeopurkar@gmail.com; helo=mail-pg1-x52a.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -7.53 X-Spam-Score: -7.53 X-Migadu-Queue-Id: 0D13B6459 X-Migadu-Scanner: mx13.migadu.com X-TUID: nGztHrTe9Xzz --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable The previous patch contained unmatched parentheses. Sincere apologies. I = am attaching a corrected patch. Best, Anand =20 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-org-colview.el-Bug-fix-for-add-appointments-to-.patch Content-Transfer-Encoding: quoted-printable From=207dd9ee45b1ed02de7921efa5c6c2a1c993a1c6ac Mon Sep 17 00:00:00 2001 From: Anand Deopurkar Date: Mon, 30 Sep 2024 10:13:59 +1000 Subject: [PATCH] lisp/org-colview.el: Bug fix for add-appointments-to-effort-sum * org-colview.el (org-columns--collect-values): Accept an additional optional argument AGENDA-MARKER (org-agenda-columns): Pass the position of the current agenda line to org-columns--collect-values through AGENDA-MARKER. Use it to read the 'duration' property Fixes the bug below. Reported-by: Stanislav Vlasov Link: https://lists.gnu.org/archive/html/emacs-orgmode/2020-08/msg00090.html also see the fix Reported-by: Mamoru Miura Link: https://lists.gnu.org/archive/html/emacs-orgmode/2022-07/msg00558.html Previously, org-agenda-columns called org-columns--collect-values from the buffer from which the agenda line originates. As a result, org-columns--collect-values did not have access to the agenda line. Mamoru Miura's solution recomputes the agenda-line. My current patch adds an optional argument to org-columns--collect-values which can be used to pass the position of the agenda line. TINYCHANGE =2D-- lisp/org-colview.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index a9eb2e0b6..f58dc1674 100644 =2D-- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -279,7 +279,7 @@ value for ITEM property." (`(,_ ,_ ,_ ,_ ,printf) (format printf (string-to-number value))) (_ (error "Invalid column specification format: %S" spec))))) =20 =2D(defun org-columns--collect-values (&optional compiled-fmt) +(defun org-columns--collect-values (&optional compiled-fmt agenda-marker) "Collect values for columns on the current line. =20 Return a list of triplets (SPEC VALUE DISPLAYED) suitable for @@ -287,7 +287,11 @@ Return a list of triplets (SPEC VALUE DISPLAYED) suita= ble for =20 This function assumes `org-columns-current-fmt-compiled' is initialized is set in the current buffer. However, it is =2Dpossible to override it with optional argument COMPILED-FMT." +possible to override it with optional argument COMPILED-FMT. + +The optional argument AGENDA-MARKER is used when called from the +agenda to pass a marker to the agenda line. +" (let ((summaries (get-text-property (point) 'org-summaries))) (mapcar (lambda (spec) @@ -300,9 +304,13 @@ possible to override it with optional argument COMPILE= D-FMT." ;; to use appointment duration. org-agenda-columns-add-appointments-to-effort-sum (string=3D p (upcase org-effort-property)) =2D (get-text-property (point) 'duration) + (get-text-property (marker-position agenda-marker) + 'duration + (marker-buffer agenda-mark= er)) (propertize (org-duration-from-minutes =2D (get-text-property (point) 'duration)) + (get-text-property (marker-posit= ion agenda-marker) + 'duration + (marker-buffer agenda-mark= er))) 'face 'org-warning)) ""))) ;; A non-nil COMPILED-FMT means we're calling from Org @@ -1758,8 +1766,9 @@ definition." ;; agenda buffer. Since current buffer is ;; changing, we need to force the original ;; compiled-fmt there. =2D (org-with-point-at m =2D (org-columns--collect-values compiled-fmt))) + (let ((agenda-marker (point-marker))) + (org-with-point-at m + (org-columns--collect-values compiled-fmt agenda-marker)))) cache))) (forward-line)) (when cache =2D-=20 2.46.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHgEARECADgWIQQvbnE/2EVbXXhD0D4/d1MuvnlmgQUCZvnv5xocYW5hbmRyZGVv cHVya2FyQGdtYWlsLmNvbQAKCRA/d1MuvnlmgTeWAJ90X3vWlYP0U9sTBh4E9LoZ vsfYAgCgm7AfwUrPXRhg01nMbIjJ6MykO3c= =RFcl -----END PGP SIGNATURE----- --==-=-=--