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 EMtVEMcO72bslAAA62LTzQ:P1 (envelope-from ) for ; Sat, 21 Sep 2024 18:21:59 +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 EMtVEMcO72bslAAA62LTzQ (envelope-from ) for ; Sat, 21 Sep 2024 20:21:59 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fvZkqMvB; 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=1726942919; 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=ePosRyRqoMgRCjKJCMZnumRPwEFJbmQLrCy304tdb4o=; b=QsJeuUGU7WYcHqC2UH4N+E9hnH4HWY7X9ogznpT6zC0lzE8OcPIJtereFd00FXfeE40xDS q8a/U6yD/LyKgYhUNCYhEk90mRVWWKnZjjX9XGFxBa8lcp7qecnTLcTWKcRbPFxmp1RNfy bByxbDsGyS8mglfiua2iohXFQzGqzFszgMDL8wTD92GGdR2dh3J5wb7/gnGbNzhe+MmCXu W2q88byS+E1kyoTrmXezFS2+XY8FBUEKBuMSS1AKp+IvOTuNPfAGwWQKPUeNTY44rqbtKE z4ijhG0p3gPhR2zitBfBw0rcai9w3DAEfscuYY8Uh8GsK1qGCiaRTRl+idgm0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fvZkqMvB; 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=1726942919; a=rsa-sha256; cv=none; b=JwdjKR+SmohJn2LPPPcAGnzVf3UMlSD6kX0XB7Ma6deoiaF8cP5QhQe/bx/ZJFa3J763C1 0n4xzIqRPvwUctA/n8unSDgF6NsSq/iTu7dE1wxqFo3yZdOFhyvN1bLUrNp9G9SwNXpTxy gqi8Sxd+fF0HL2QNsJWG1PMAtRgQyKOEs6vCjN6c04AqDM2HK+VRqY8PnFm4+LFps7EOnG X7/KFBiuDjHp5u6iRfiOk8N++GO+wli/GpRYkt4HEr7d5Dd/jAGYzess0tU9o3q1ezOBIw fHd8wV+GHKFoNb9LOMi9ZyqXmLAySNYNKAMlsMVQeRZHyL2oXTd4GKvynYzIFA== 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 D57833CA8 for ; Sat, 21 Sep 2024 20:21:58 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ss4j5-0007bs-Bb; Sat, 21 Sep 2024 14:20: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 1ss4j3-0007bZ-LF for emacs-orgmode@gnu.org; Sat, 21 Sep 2024 14:20:57 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ss4j2-0000Bq-1H for emacs-orgmode@gnu.org; Sat, 21 Sep 2024 14:20:57 -0400 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-7d4f8a1626cso2675272a12.3 for ; Sat, 21 Sep 2024 11:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726942854; x=1727547654; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ePosRyRqoMgRCjKJCMZnumRPwEFJbmQLrCy304tdb4o=; b=fvZkqMvBt1n9DucJYSi0p7KWgmq9kfoU4khFqtF29RcZzNoQ1JeNV7uaDAL4L9PU3f 44uke0apnB5251A6QLli+huTDf3pchfULGCD7nzgLpNf0k6srdSLX6EBNkqrPxrW7N6G JCfogUjHbcYIiZGHJLSnTpwJ73wwl9zv8LnifhCRb5zaIjszb3VKJAbcNqVHqK7XDEFB 72YcqbESLkWRAFOg0ophxm4ipsixB2yAoUcz0DeEriHDq1wb5RJ2NoDU49gsDLJ1HKWS SbcPXRYPzPzfg2u4jxLM4hI9Ia7A7n8e+EWs0rZn6wQ6Oj+pN0b/8TE44Nbbq1rJQosv sRtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726942854; x=1727547654; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ePosRyRqoMgRCjKJCMZnumRPwEFJbmQLrCy304tdb4o=; b=e1EeNq7x64Ycrvkqwv3hwjsLlIDYvVviX3556/brHVzCdj/mHFd7wGvde5JIffTdIm Bw17Zp98QBPJ+3C0BL/Mp0XO6qyXur0cdADvlCayRIIbtPLe8A6ERR4br4y3p0JrrZ1F 6GEnELZAZV7t1iBZ5rCU18Sr3H/YQYa8ELvU2qBk50F2limr/narlaNNBjRMbyPjAFzG vMxUfHfmqa1TGMnTDjLZo6snX2L3ob9Bk4BGs/PxWA+IExrEpWCPsoEGXHkpCsUzDkyg 8YG3LHJxHiW4gC8Eo2/mmRJ7GoPDVhEI191QhAVLGMIc28HKk4qstbRlJYLfZjgEGRdF 8JcQ== X-Gm-Message-State: AOJu0YwLCHk+rtMhKZUioLTMsIKe8l0HRYgL7kX4sds0WUHRmlYQ1Hfo 0CCfoIei+Vf5vsHF8RYSulAk5pemI/+Mx65vBfAnU6aqrc4xRdtWxqQbPA== X-Google-Smtp-Source: AGHT+IEU2udMyQvTmmBE+m0moBKCIiRFES651jSr6eugKGv2PR8CBBuwESurw2XaO7BCEF+1CaThQA== X-Received: by 2002:a05:6a20:d807:b0:1d2:e90a:f4cd with SMTP id adf61e73a8af0-1d30a987fddmr11853937637.35.1726942854068; Sat, 21 Sep 2024 11:20:54 -0700 (PDT) Received: from localhost ([198.27.183.102]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944a9759esm11529452b3a.44.2024.09.21.11.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2024 11:20:52 -0700 (PDT) From: Jack Kamm To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Fix ox-icalendar export of diary timestamps In-Reply-To: <875xqppeur.fsf@localhost> References: <87y13tqvpd.fsf@gmail.com> <875xqppeur.fsf@localhost> Date: Sat, 21 Sep 2024 11:20:51 -0700 Message-ID: <87v7yorhq4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=jackkamm@gmail.com; helo=mail-pg1-x529.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: -4.11 X-Spam-Score: -4.11 X-Migadu-Queue-Id: D57833CA8 X-Migadu-Scanner: mx10.migadu.com X-TUID: ZXdEAuhd3TUI --=-=-= Content-Type: text/plain Ihor Radchenko writes: > I agree that it makes sense. > However, it is technically a breaking change. > May you please add a news entry as well? Thanks, I've updated the patch with a news entry now. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ox-icalendar-Fix-export-of-diary-style-timestamps.patch >From 5c40741664402a5984803dc3de452ea949885887 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Sat, 14 Sep 2024 22:48:44 -0700 Subject: [PATCH] ox-icalendar: Fix export of diary-style timestamps * lisp/ox-icalendar.el (org-icalendar-entry): Include timestamps of type diary when `:with-timestamps' is `active'. * lisp/ox.el (org-export--skip-p): Include timestamps of type diary when `:with-timestamps' is `active'. * testing/lisp/test-ox-icalendar.el (test-ox-icalendar/diary-timestamp): Unit test for exporting timestamps of type diary. --- etc/ORG-NEWS | 14 ++++++++++++++ lisp/ox-icalendar.el | 2 +- lisp/ox.el | 2 +- testing/lisp/test-ox-icalendar.el | 15 +++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index a9357aa28..d31c62721 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -57,6 +57,20 @@ remote resources in the =#+include:='s. Now, an error is thrown to avoid seemingly ignored =#+include= statements when publishing via batch scripts. +*** Diary-style timestamps are exported together with active timestamps + +~org-export-with-timestamps~ and ~org-icalendar-with-timestamps~ now +treat diary-style timestamps as a type of active timestamp for +purposes of export. + +This mainly affects iCalendar export, where diary timestamps will now +be included when only active timestamps are exported (the default). + +This should have minimal impact on non-iCalendar exporters, since +~org-export-with-timestamps~ was already ~t~ by default. However, +users who manually set ~org-export-with-timestamps~ to ~active~ will +now have diary timestamps included as well. + ** New features # We list the most important features, and the features that may diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 858d146d6..e7ca6aafb 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -746,7 +746,7 @@ (defun org-icalendar-entry (entry contents info) (lambda (ts) (when (let ((type (org-element-property :type ts))) (cl-case (plist-get info :with-timestamps) - (active (memq type '(active active-range))) + (active (memq type '(active active-range diary))) (inactive (memq type '(inactive inactive-range))) ((t) t))) (let ((uid (format "TS%d-%s" (cl-incf counter) uid))) diff --git a/lisp/ox.el b/lisp/ox.el index 7a0ab4dc7..79a1f5cfb 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -1857,7 +1857,7 @@ (defun org-export--skip-p (datum options selected excluded) (cl-case (plist-get options :with-timestamps) ((nil) t) (active - (not (memq (org-element-property :type datum) '(active active-range)))) + (not (memq (org-element-property :type datum) '(active active-range diary)))) (inactive (not (memq (org-element-property :type datum) '(inactive inactive-range))))))))) diff --git a/testing/lisp/test-ox-icalendar.el b/testing/lisp/test-ox-icalendar.el index e631b2119..c7c74c526 100644 --- a/testing/lisp/test-ox-icalendar.el +++ b/testing/lisp/test-ox-icalendar.el @@ -128,5 +128,20 @@ (ert-deftest test-ox-icalendar/warn-unsupported-repeater () (when (file-exists-p tmp-ics) (delete-file tmp-ics)))))))) +(ert-deftest test-ox-icalendar/diary-timestamp () + "Test icalendar export of diary timestamps." + (let* ((tmp-ics (org-test-with-temp-text-in-file + "* First Sunday of the month +<%%(diary-float t 0 1)>" + (expand-file-name (org-icalendar-export-to-ics))))) + (unwind-protect + (with-temp-buffer + (insert-file-contents tmp-ics) + (save-excursion + (should (search-forward "SUMMARY:First Sunday of the month"))) + (save-excursion + (should (search-forward "RRULE:FREQ=MONTHLY;BYDAY=1SU")))) + (when (file-exists-p tmp-ics) (delete-file tmp-ics))))) + (provide 'test-ox-icalendar) ;;; test-ox-icalendar.el ends here -- 2.46.0 --=-=-=--