From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eKUGJ9U4x2H4JwEAgWs5BA (envelope-from ) for ; Sat, 25 Dec 2021 16:29:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id oKm7ItU4x2FLUwAAB5/wlQ (envelope-from ) for ; Sat, 25 Dec 2021 15:29:25 +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 50C2F25CDB for ; Sat, 25 Dec 2021 16:29:25 +0100 (CET) Received: from localhost ([::1]:34144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n18z6-0006c7-Gq for larch@yhetil.org; Sat, 25 Dec 2021 10:29:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n18ui-0002Lz-7s for emacs-orgmode@gnu.org; Sat, 25 Dec 2021 10:24:52 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:46075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n18ug-00036t-KY for emacs-orgmode@gnu.org; Sat, 25 Dec 2021 10:24:51 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3ABDB5C00FE for ; Sat, 25 Dec 2021 10:24:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 25 Dec 2021 10:24:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eml.cc; h= message-id:subject:from:to:content-type:date:mime-version :content-transfer-encoding; s=fm2; bh=viCfIRM5lKFbdlnbVq7BaLtJMC akI6lgUvQVa8P4LiM=; b=RxvXfAFYVPqT07qcRXb1NElZvx64LWKo6DXJwKWGxu +wqBZlD7d7nc19qAqwyEsbtYJ0l86ILwRl4TIWzC+vhGLv66iWUechUfhCGfdBUd esYZ3iPZygUjj6gM/ZPF0X1RDhg484ZVeueVhwcafSs70124ljawK1gHhf0tBIPc LKcyp/2vntzHhdAjmaTh99oXF11jJR50WvIeUoPNHwC90HMRa29sPwQczn5Y5sOO /bRaMvN4fHgh5HmHWfw87Y/XDl9fnmEvRARVuSMxV420sgZ4a7ZtFdtaFu+9snqc HUJKww1z/X9amwlrKiVYQBwi2oD9l0lXgpN2EZNRX2Ww== 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=fm1; bh=viCfIR M5lKFbdlnbVq7BaLtJMCakI6lgUvQVa8P4LiM=; b=SCBCJLH73hvPAH9xOTPWbv gCHfkudbRBotTzCKA1V3Q6yHcvOTM3zGYj5sdT7nVoPERVkl/BSqvOtbmNDRH8xo 0aXdm27L15Gbz0r0fioe1Ne3FpP4U4noUKpglQIruxHGNHv7AB3dFqZYk3hixNvS sXkZMojbnsPoCdNwXDRfpBR/2D2HoYI8FVeVpFrDC6n2jAqH3smFwexBeEDgS7Vb hvwI76XTsAFaHyTKWR3PpYu7u1+rHSD1E9eq/gsIKoFSzln6YU4YD3jhLtX7TET3 q2HZESmEJULpiUQQt30fHBQ1fN72NNJ54hkx5PVU2QY5UvNndrbd8fCAFln8bxYg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudduvddgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfedtmdenucfjughrpefkuffhvfgtffggfgfgsehtkeertddtreej necuhfhrohhmpefoihhkhhgrihhlucfukhhorhiihhhinhhskhhiihcuoehmshhkohhrii hhihhnshhkihihsegvmhhlrdgttgeqnecuggftrfgrthhtvghrnhephefggfehiedtleev ffetgfeiffegjeevuddtkeeiveeufffhffdtleektdettdefnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhskhhorhiihhhinhhskhhihies vghmlhdrtggt X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 25 Dec 2021 10:24:49 -0500 (EST) Message-ID: Subject: [PATCH] ox-icalendar.el: create alarm at event time From: Mikhail Skorzhinskii To: Org Mode Content-Type: text/plain; charset="UTF-8" Date: Sat, 25 Dec 2021 16:24:15 +0100 MIME-Version: 1.0 User-Agent: Evolution 3.40.0-1 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.111.4.26; envelope-from=mskorzhinskiy@eml.cc; helo=out2-smtp.messagingengine.com 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640446165; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=viCfIRM5lKFbdlnbVq7BaLtJMCakI6lgUvQVa8P4LiM=; b=tDWDYgLf96viE3ldAM3r+3rz20TRSLRb6Uspl7q/6/I6VYHgXY5kiNBz81ErUHaSiQEVMc 5//euGVO7bMfDm/8RrPb1y5qJxmVu3uPZT5H+rmoTUkglsXkns99qmu+8O+C7K2LeQY0e6 wtUjJ8RfceCcXRJdQmyHb4ycJpW1+odEmWshu5KnZy9HIzhCS2xb5vIntJCgi+4P5vj2oW ZWUL8W8idYak5Nn6yH8JixzjSMeV2ebf/jnGdGIINEA8VasYjeK5mIGoxt5Ur1Ns80OWo5 BfmLoNgngJQcXtatdWUkHy2ej1CTKliMkASBqC0NaB9AniYySsgVzjqstctEnw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640446165; a=rsa-sha256; cv=none; b=KJIdeI+3XF8E68+v46sg61kEzMVMmcNNdWYR6eQIrfWTA5U7XbnK3RxbjPG67byt68Q7DA hQKx3DojjGZ8eBl8DFRSDwIYjjDOh2P9MTraWGQyb212MIkejGBOc84aE23t9OZTwXTSeV YEIseY1jXzGlokwHJNJ2cf47dwUNrKr1JHY4bmLQfLBlLncidNfBSCeyiC4Xb4URLiIgSP MFrKJUO8xRZyEMWg+J7C4I8AlXhYXiL1fF901bF9OrNWfTeUNYUHdDBVYBaNJz+r639fuJ F/R/VCfWLkMHGZeXWQheqKccohdpkcBzB4g7ND+H4FP7fT7TVcZuRHtG9YDxiQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=eml.cc header.s=fm2 header.b=RxvXfAFY; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=SCBCJLH7; dmarc=pass (policy=none) header.from=eml.cc; 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" X-Migadu-Spam-Score: -7.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=eml.cc header.s=fm2 header.b=RxvXfAFY; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=SCBCJLH7; dmarc=pass (policy=none) header.from=eml.cc; 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" X-Migadu-Queue-Id: 50C2F25CDB X-Spam-Score: -7.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: S26QC//OMuwV * lisp/ox-icalendar.el (org-icalendar-force-alarm): option to set alarm even if alarm time is set to zero. * lisp/ox-icalendar.el (org-icalendar--valarm): create VALARM at the event start if the alarm time is set to zero and `org-icalendar-force-alarm' is set to true. ---  lisp/ox-icalendar.el | 24 +++++++++++++++++++++---  1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 0a56e08e5..15b5e3e37 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -66,6 +66,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 @@ -803,8 +812,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 @@ -812,7 +824,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