From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id AEeXEv/58WZUQAAA62LTzQ:P1 (envelope-from ) for ; Mon, 23 Sep 2024 23:30:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id AEeXEv/58WZUQAAA62LTzQ (envelope-from ) for ; Tue, 24 Sep 2024 01:30:07 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JI6qwrrs; 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=1727134207; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=AB9haUfaZ2Cl5R7XbfsYljhBmkyteMuHWjyOHoiyc8U=; b=DJBhNHHa/nE3FCQF6eD5fvvLeQ1B/wtt9S1nJxM//rZEGZQcYyTrjAMYf6AgbjOyAplx4/ 1u7odY3B/Uyi3IrK74LNJaiITinKUDDHZGA5pW04mqlCPtDQ1CmxvFx2g5RanzS7eC4iH8 123tl7x8l8tLo8tXhfME1TIWEzNMFFq4L/wIx+2Ld3cMIJ79jHOyAC9jidPi9LLGwTXthH AGnyu8DUlUBGwrQRgYXbsM5sRh0XabPmcA3o6xCwm4imnrty7ebKzZxDh2FPAEn0vjkg/i iCR0e5gHh7pfB8HtQbrGz3mGBlejyIm+cDQ21jL1IsT6pzgKjc1gByZ4TzGN8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JI6qwrrs; 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=1727134207; a=rsa-sha256; cv=none; b=Re3KWsOYFEOF5shl2T9ihl85/L63h5Ryooat97BQti7A9SSak0pfxuOPqcib8grHMNvqYy lmKFj1aG1QCYy5zHUvVM6rkTJBNxJRGGjm3dutsKhUbKAG0q9ZXyb+YuKwqy5z7nhqr3H/ 2UYDbtWvphnd3NKs98iMOQ+Wf54kEqAYtD86UIiOb+6pC2MTFFDu/CPNzUfFnNL5Llaaqn 0Xt7Xe0kd2eqwvKbmsc9yiN0RvOyHfe+oO8Rox4349c3Bad9KNwTxfWSh+Fffn9RY5rEhF C8eV73ihnrmLqhGXi6bgFSI3ItGjV0VkquGU9ZkYQGBMAu1ab7HuKi8iJ+GzsQ== 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 3CA58794B6 for ; Tue, 24 Sep 2024 01:30:05 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sssPP-0000lz-BE; Mon, 23 Sep 2024 19:23:59 -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 1sssPN-0000lo-87 for emacs-orgmode@gnu.org; Mon, 23 Sep 2024 19:23:57 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sssPL-0007mG-8j for emacs-orgmode@gnu.org; Mon, 23 Sep 2024 19:23:56 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-20543fdb7acso38458585ad.1 for ; Mon, 23 Sep 2024 16:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727133833; x=1727738633; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=AB9haUfaZ2Cl5R7XbfsYljhBmkyteMuHWjyOHoiyc8U=; b=JI6qwrrslOQmjtWb0nKSMMVr/0U7tBPNHDp2vipn6SjkuIJgvIJ+NgkvnmPACSBhIW tYacD4touVRy+CuNdzsqzQOobU/7dwffct57KAPpZksChLjXOkE9TiJcjWzyQbxK4moz JAHrCm2eLAT+hhtzafoLHULZMAmjIhQXA6y8qh7BvKqv24xqx3ftqAINgVc4VvYBn0F1 1F0VhGBB3zqyy4LrhzBoeKANHO/P/bw1lzFBO4Jv7PfyAfuwWx886k9a6hFnTLcgQkKP n7bhtkPW8Lh/DAIhp7UkwdrBCNaHW3rF5J8sYDYaXRfqIXyhQuE/As/7K2mY1NLY+t9A tDbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727133833; x=1727738633; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AB9haUfaZ2Cl5R7XbfsYljhBmkyteMuHWjyOHoiyc8U=; b=kT+fBuc+vFqvTFqPWvMJfzZTiPn0b3nbAij6ueE5t/Uo6JB4P9udGOQTbNRd3pTME3 MV/G5a09DxChIL3jUn+T4Uy4R6DeuNYJ+KCRV/FjGqe3Bprrx+o68OXuBmPbM+vwjEhm jYY4xDQIInpizgOqkL0NzTtg0iOoHr7S+23kyPMCsIlhF1TS4DXDuLOzUiihBqvP4O8h toWMQPO0hDDtO/qMmhIaa+WJED87jBKRaa6MWdPcjTvl2LVQSA9RLASipOri0FfHYNhd 9I0U+ftXAGR3YzrgaG6P78tOA1v5yO2uCfeuFbe455g0DLYcx/S6pSAwvKEZv6gBR9vo aQfQ== X-Gm-Message-State: AOJu0Yx4BBVWqplSy7yjMloweIdLB1z0DLyXmA9f6Y2Adc4LyOa0Q98c 8DUkn/FUoPUT2mxS56R9Wn/k12QQukGmoJd649hYfO7Snp2jpqxSMIr6pQ== X-Google-Smtp-Source: AGHT+IH9Ox6+/Mtp5t4n81poXpERQ7Ci6tXA4t7lgDbg+Jv5ecVNuZxPi9ugNGzg5qQjnvGqzGMy4Q== X-Received: by 2002:a17:902:cf04:b0:1fc:6b8b:4918 with SMTP id d9443c01a7336-208d84418b4mr180735005ad.41.1727133833487; Mon, 23 Sep 2024 16:23:53 -0700 (PDT) Received: from tippah (tippah.anu.edu.au. [150.203.32.218]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af16df902sm878355ad.38.2024.09.23.16.23.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 16:23:51 -0700 (PDT) From: Anand Deopurkar To: emacs-orgmode Subject: [PATCH] lisp/org-colview.el: Fix for adding appointments to effort sum Date: Tue, 24 Sep 2024 09:23:46 +1000 Message-ID: <87y13ij6nx.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::632; envelope-from=anandrdeopurkar@gmail.com; helo=mail-pl1-x632.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 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.21 X-Spam-Score: -7.21 X-Migadu-Queue-Id: 3CA58794B6 X-Migadu-Scanner: mx10.migadu.com X-TUID: 40ULoBF8C6Rl --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= 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=200b6fbd5bc1326163e16351cee6ee267777e7ecf8 Mon Sep 17 00:00:00 2001 From: Anand Deopurkar Date: Mon, 23 Sep 2024 22:58:48 +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..486badf1e 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: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Anand Deopurkar Mathematical Sciences Institute The Australian National University Ngunnawal and Ngambri Country Canberra ACT 2601 Australia --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHgEARECADgWIQQvbnE/2EVbXXhD0D4/d1MuvnlmgQUCZvH4ghocYW5hbmRyZGVv cHVya2FyQGdtYWlsLmNvbQAKCRA/d1MuvnlmgQSlAJ92hTwwPZ1tcZO+B78oUPHi j5KUuQCeKswhUCnROmDrXpcInmkSvts115A= =1I1U -----END PGP SIGNATURE----- --==-=-=--