From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4OgIOMSG4Wa9DgAAqHPOHw:P1 (envelope-from ) for ; Wed, 11 Sep 2024 12:02:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 4OgIOMSG4Wa9DgAAqHPOHw (envelope-from ) for ; Wed, 11 Sep 2024 14:02:13 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726056132; 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; bh=ARyl7NMvuBR/QH3XSbOS0PxtHLInFWSbIuwKJULNOpU=; b=Ql/6EoRze2VoYOYmhmbzdNG2bPKhlLg/971dg5KYP5R2ua5youVnjhsqQOHhlhs4xPUSGN tTQoHSOfdD2VeT+KcJfsMrllI+VyouU/0rHFQCjLWjptl1SoR6LqVk7O3YtP2FyRKtcaxs ySgNtKo2pUom26bVW7sx4LgWSH019RI5wCm5q8z26GqpKJkQzlcPxocnIE3zcCR0/xnK+i PkbGF+ICMjKxmANBAIK4P7YyeEmbPlHGMH6ube/MXxFCU5qVhGiHGkcXLijCTnbyxaKsyl douHTRlzRQN0e0ua9w7KrSqWpNcIT31TAQHpaNar8qv0apBkgoNgXzUBZX2krw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726056132; a=rsa-sha256; cv=none; b=qi0w7gPOkcsXExgsHRzzhbsqvHVsYtdTMBKnOdPm1/XL+BH67K2D+4Pq4FVyocpCwJVGhu OTyr83C6s7O1FuPfQmkpqfvzcxuONeJ2DhjOfoPgovjCba7c1V2DFwCHXf+VD7CHtSMkMa Pm63h3Osy41h1gCKYTKXOWoXgro1apr3Pj0Qd7vvt9GcKRdrUEXnMHZBASuLHT6oVT3NPs Ai3UGRDzg6qI7CpqIK9fVyYzHdPwuBYhFDJSETUDri9c3kmIMF4VNLgfJfio4sY8Hg/RI6 KnG1zwt/bYQpwq7jZ8p8eZ18GQn6fd1IfPBp9MYkkOGSKreO5VSqmlpAkW8zfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" 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 8A39E50B8 for ; Wed, 11 Sep 2024 14:02:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soM2N-000723-Mr; Wed, 11 Sep 2024 08:01:31 -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 1soM2K-0006rx-P8 for emacs-orgmode@gnu.org; Wed, 11 Sep 2024 08:01:30 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soM2G-0004s6-GM for emacs-orgmode@gnu.org; Wed, 11 Sep 2024 08:01:28 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2B31FC0007 for ; Wed, 11 Sep 2024 12:01:19 +0000 (UTC) Content-Type: multipart/mixed; boundary="------------KccNrofpv4RnqUxjstGxmVGi" Message-ID: Date: Wed, 11 Sep 2024 14:01:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: emacs-orgmode@gnu.org From: Guido Stevens Subject: support range durations Organization: Cosent -:- social knowledge technology X-GND-Sasl: guido.stevens@cosent.net Received-SPF: pass client-ip=2001:4b98:dc4:8::226; envelope-from=guido.stevens@cosent.net; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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: -2.48 X-Spam-Score: -2.48 X-Migadu-Queue-Id: 8A39E50B8 X-Migadu-Scanner: mx11.migadu.com X-TUID: rlwaU25PzejQ This is a multi-part message in MIME format. --------------KccNrofpv4RnqUxjstGxmVGi Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi all, I'm new to this list and joined in order to submit the attached tiny patch. As per https://orgmode.org/manual/Column-attributes.html I'm using range durations to express effort estimations. Those get summarized nicely in column views, using the {est+} summarizer. But when I access an agenda view that encounters a task that has such a range duration directly set, the agenda chokes with an error message: org-duration-to-minutes: Invalid duration format: "1d-2d" Attached patch fixes that error, by 1. Just before throwing that error, checking if this is potentially a range duration, of two durations separated by a "-" 2. If so, split the range into two separate and durations, convert each of those to minutes, and take the average. The patch doesn't use a fancy regexp. Instead, it recurses into org-duration-to-minutes and reapplies all sanity checks on the constituent low/high durations. If you have two valid durations connected by a dash (and optionally whitespace), that's a valid range duration, and it will be expressed as a float. If not, you'll hit the error fallback directly below. Applying this patch fixes my agenda view when using range durations. Since the actual code change is just 2 lines, I opted to forego the FSF copyright assignment caroussel by marking this a TINYCHANGE. Patch is based off e269942a353965dd8bdad57741adc9c53116a08a which is my current Doom Emacs checkout of https://github.com/emacs-straight/org-mode. I hope that's fine. Kind regards, Guido. -- Guido Stevens | Cosent | https://cosent.nl s o c i a l k n o w l e d g e t e c h n o l o g y --------------KccNrofpv4RnqUxjstGxmVGi Content-Type: text/x-patch; charset=UTF-8; name="0001-lisp-org-duration.el-support-range-durations.patch" Content-Disposition: attachment; filename="0001-lisp-org-duration.el-support-range-durations.patch" Content-Transfer-Encoding: base64 RnJvbSA3NzJjYTRjOTE1YTYyOWE2MmJlMGI1ZWU2NDAwNWE5MjliZjFiZjA0IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiAiR3VpZG8gQS5KLiBTdGV2ZW5zIiA8Z3VpZG8uc3Rl dmVuc0Bjb3NlbnQubmw+CkRhdGU6IFdlZCwgMTEgU2VwIDIwMjQgMTM6MjQ6NTggKzAyMDAK U3ViamVjdDogW1BBVENIXSBsaXNwL29yZy1kdXJhdGlvbi5lbDogc3VwcG9ydCByYW5nZSBk dXJhdGlvbnMKCiogbGlzcC9vcmctZHVyYXRpb24uZWwgKG9yZy1kdXJhdGlvbi10by1taW51 dGVzKTogRG8gbm90IGNob2tlIG9uCmxvdy1oaWdoIHJhbmdlIGR1cmF0aW9ucyAoZS5nLiAi MmQtNWQiKSB3aGVuIHJlbmRlcmluZyBhbiBhZ2VuZGEuIENhbGN1bGF0ZSB0aGU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