From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IK6CO1uUaF9ZKQAA0tVLHw (envelope-from ) for ; Mon, 21 Sep 2020 11:54:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CN9UN1uUaF/NDQAA1q6Kng (envelope-from ) for ; Mon, 21 Sep 2020 11:54:03 +0000 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 C9099940650 for ; Mon, 21 Sep 2020 11:54:02 +0000 (UTC) Received: from localhost ([::1]:60660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKKON-0004Y3-PE for larch@yhetil.org; Mon, 21 Sep 2020 07:53:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKKBM-0006QQ-UY for emacs-orgmode@gnu.org; Mon, 21 Sep 2020 07:40:34 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:48939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKKBI-00022o-BT for emacs-orgmode@gnu.org; Mon, 21 Sep 2020 07:40:30 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id DF82DB11 for ; Mon, 21 Sep 2020 07:40:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 21 Sep 2020 07:40:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eml.cc; h=from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm1; bh=cnf52qglFPu3aA6CT2gSqgu15N 8j7mNPIIXwVptoTjA=; b=otYQuB1fUQxZ/dsIIOMp0FnU5IHfLEyL1MctjRPPP6 /cgKzf4jqaUDC33oMzJ2Tg/ws2gsxHjprgXkFjvLAFB2Nzh+Ogr9FywHRPv7YcFD /TfEjyJENmooj/EGWszroi1klP9ihZ4sfakiEsUf7JKhuv+8PDzY+DRaZKA8JN7Y rcYg1XAdm/BLCv2YkcimGmEX6UU01ZUMf3dkMqXnKd/8qiz8SRfOlrphd5wT8q+Y 9Xa9v7qxlzvuGOdNKJxIPmxsFP8Oyyl9F4tbQqIQZZ4dfpMRrTNzTM/qdseoK2Cb NtZKcplspig+f3xZoU47ikpyC3brnJW8fuLpIds3Co5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=cnf52q glFPu3aA6CT2gSqgu15N8j7mNPIIXwVptoTjA=; b=unsFKTRXTHR/XPIGyQLC8D NmX0rqMQi4aMHz/1zRaEYjVF7s/bova19sjIvVFOsIxMALQS9G+xAQ2HH3ChTJj+ RMth9yrqxx+myS7vATE6ccZMs9Tmp6QPXqhUICiBS2v1jxVZrENS4deBRh3HRAy8 Jq4bspg1iIkwWlWwI0hh04JNcWPmQgA9czGl4HEGXISBtSrtjiuRdkbHvNqrGq4M bC3ersFmSmNnFxLw3yW71pd7DgufKAYoGlUa5ryPTN7qrQu/T+SLHgguHdlcIdIV XBaCVXAjRVlXSFAu+p8ZeTH2RVrb0T9A/Q1rdym6BcRL2x2joJ/OGCjn+wnQ1/eA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddvgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdduhedmnecujfgurhephffvuf ffkfggtgfgsehmuferredttddvnecuhfhrohhmpefoihhkhhgrihhlucfukhhorhiihhhi nhhskhhiihcuoehmshhkohhriihhihhnshhkihihsegvmhhlrdgttgeqnecuggftrfgrth htvghrnhepgefgveehkeegtdeuudegvdeigeevfeeuueejgeegtddtteetvdeifffhtdei iedvnecuffhomhgrihhnpehgnhhurdhorhhgnecukfhppeejkedruddtjedrvddthedrud dtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhs khhorhiihhhinhhskhhihiesvghmlhdrtggt X-ME-Proxy: Received: from trex230.localnet (78-107-205-10.broadband.corbina.ru [78.107.205.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 0DE073064674 for ; Mon, 21 Sep 2020 07:40:25 -0400 (EDT) From: Mikhail Skorzhinskii To: emacs-orgmode@gnu.org Subject: [PATCHES 1, 2/2 v2] ox-icalendar: add customisations for summary cookies and allow zero alarm Date: Mon, 21 Sep 2020 13:40:28 +0200 Message-ID: <2104640.gBco5zGie4@trex230> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2215930.RqaOCoLdbC" Content-Transfer-Encoding: 7Bit Received-SPF: pass client-ip=64.147.123.21; envelope-from=mskorzhinskiy@eml.cc; helo=wout5-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/21 07:29:21 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.23 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=eml.cc header.s=fm1 header.b=otYQuB1f; dkim=fail (rsa verify failed) header.d=messagingengine.com header.s=fm3 header.b=unsFKTRX; dmarc=fail reason="SPF not aligned (relaxed)" header.from=eml.cc (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 1.09 X-TUID: L2Oa/HEuFckE This is a multi-part message in MIME format. --nextPart2215930.RqaOCoLdbC Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hello forum, I've already submitted these features to the mailing list: https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00628.html But even if these changes are really tiny and minor, they are touching very different functionality of org-mode. It wasn't good mixing my suggestions for agenda and for ox-icalendar. So I'm starting a separate mail thread for my suggestions. Changes since v1: - Add missing group and type to org-icalendar-*-summary-prepend defcustoms; Kind regards, Mikhail Skorzhinskii --nextPart2215930.RqaOCoLdbC Content-Disposition: attachment; filename="0002-ox-icalendar.el-introduce-setting-to-force-alarms.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="utf-8"; name="0002-ox-icalendar.el-introduce-setting-to-force-alarms.patch" >From ecc65f713ff3efdfc40e90141dc070fc291d599f Mon Sep 17 00:00:00 2001 From: Mikhail Skorzhinskii Date: Sat, 12 Sep 2020 18:52:39 +0200 Subject: [PATCH 2/2] ox-icalendar.el: introduce setting to force alarms This is a new setting for icalendar exports to allow users set alarms exactly at the event start. With this setting set to non-nil and alarm set to zero (by global setting or APPT_WARNTIME property) it will create an alarm at the event start. Note, that zero alarm set as APPT_WARNTIME property will override default warning time. --- etc/ORG-NEWS | 10 ++++++++++ lisp/ox-icalendar.el | 24 +++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index cc471e20b..0fd3d8792 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -22,6 +22,16 @@ area instead of file name. Through these new options for icalendar export, one can customise the looks of summary lines in exported events. +*** New option ~org-icalendar-force-alarm~ + +This is a new setting for icalendar exports to allow users set alarms +exactly at the event start. With this setting set to non-nil and alarm +set to zero (by global setting or APPT_WARNTIME property) it will +create an alarm at the event start. + +Note, that zero alarm set as =APPT_WARNTIME= property will override +default warning time. + * Version 9.4 ** Incompatible changes *** Possibly broken internal file links: please check and fix diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 39807c7c2..9ac6435a6 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -64,6 +64,15 @@ for timed events. If non-zero, alarms are created. :version "24.1" :type 'integer) +(defcustom org-icalendar-force-alarm nil + "Non-nil means alarm will be created even if is set to zero. + +This overrides default behaviour where zero means no alarm. With +this set to non-nil and alarm set to zero, alarm will be created +and will fire at the event start." + :group 'org-export-icalendar + :type 'bool) + (defcustom org-icalendar-combined-name "OrgMode" "Calendar name for the combined iCalendar representing all agenda files." :group 'org-export-icalendar @@ -802,8 +811,11 @@ Return VALARM component as a string, or nil if it isn't allowed." (let ((alarm-time (let ((warntime (org-element-property :APPT_WARNTIME entry))) - (if warntime (string-to-number warntime) 0)))) - (and (or (> alarm-time 0) (> org-icalendar-alarm-time 0)) + (if warntime (string-to-number warntime) nil)))) + (and (or (and alarm-time + (> alarm-time 0)) + (> org-icalendar-alarm-time 0) + org-icalendar-force-alarm) (org-element-property :hour-start timestamp) (format "BEGIN:VALARM ACTION:DISPLAY @@ -811,7 +823,13 @@ DESCRIPTION:%s TRIGGER:-P0DT0H%dM0S END:VALARM\n" summary - (if (zerop alarm-time) org-icalendar-alarm-time alarm-time))))) + (if org-icalendar-force-alarm + (if alarm-time + alarm-time + org-icalendar-alarm-time) + (if (zerop alarm-time) + org-icalendar-alarm-time + alarm-time)))))) ;;;; Template -- 2.28.0 --nextPart2215930.RqaOCoLdbC Content-Disposition: attachment; filename="0001-ox-icalendar.el-allow-to-customise-deadline-and-sche.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="utf-8"; name="0001-ox-icalendar.el-allow-to-customise-deadline-and-sche.patch" >From 90bce01b8e97943ba90c7a9c720350bc04951a27 Mon Sep 17 00:00:00 2001 From: Mikhail Skorzhinskii Date: Sat, 12 Sep 2020 18:27:23 +0200 Subject: [PATCH 1/2] ox-icalendar.el: allow to customise deadline and scheduled items summary In some of export schemes these cookies at the start of each event can be a distraction rather then storage of useful information. --- etc/ORG-NEWS | 5 +++++ lisp/ox-icalendar.el | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index e30336f45..cc471e20b 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -17,6 +17,11 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org. When set to 'title, will show document title in outline path in echo area instead of file name. +*** New options ~org-icalendar-scheduled-summary-prepend~ and ~org-icalendar-deadline-summary-prepend~ + +Through these new options for icalendar export, one can customise the +looks of summary lines in exported events. + * Version 9.4 ** Incompatible changes *** Possibly broken internal file links: please check and fix diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 0f890534a..39807c7c2 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -82,6 +82,17 @@ keyword." :group 'org-export-icalendar :type '(repeat (string :tag "Tag"))) +(defcustom org-icalendar-scheduled-summary-prepend "S: " + "String used for prepending summary in exported scheduled headlines." + :group 'org-export-icalendar + :type 'string) + + +(defcustom org-icalendar-deadline-summary-prepend "DL: " + "String used for prepending summary in exported deadlines." + :group 'org-export-icalendar + :type 'string) + (defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due) "Contexts where iCalendar export should use a deadline time stamp. @@ -606,7 +617,7 @@ inlinetask within the section." (_ (memq 'event-if-not-todo use-deadline))) (org-icalendar--vevent entry deadline (concat "DL-" uid) - (concat "DL: " summary) loc desc cat tz class))) + (concat org-icalendar-deadline-summary-prepend summary) loc desc cat tz class))) (let ((scheduled (org-element-property :scheduled entry)) (use-scheduled (plist-get info :icalendar-use-scheduled))) (and scheduled @@ -617,7 +628,7 @@ inlinetask within the section." (_ (memq 'event-if-not-todo use-scheduled))) (org-icalendar--vevent entry scheduled (concat "SC-" uid) - (concat "S: " summary) loc desc cat tz class))) + (concat org-icalendar-scheduled-summary-prepend summary) loc desc cat tz class))) ;; When collecting plain timestamps from a headline and its ;; title, skip inlinetasks since collection will happen once ;; ENTRY is one of them. -- 2.28.0 --nextPart2215930.RqaOCoLdbC--