aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Coble2025-06-07 18:26:55 -0400
committerArun Isaac2025-06-08 03:07:59 +0100
commita50bd935df695e1f6e720761cba39c34af0c1cda (patch)
treeb122b792548d2e74ea15e23f6c547eca82929423
parent388f05f22a4498632ce16b4a8f49a46d109c62e4 (diff)
downloadvaruga-a50bd935df695e1f6e720761cba39c34af0c1cda.tar.gz
varuga-a50bd935df695e1f6e720761cba39c34af0c1cda.tar.lz
varuga-a50bd935df695e1f6e720761cba39c34af0c1cda.zip
Format ORGANIZER CN as property parameter.
* varuga.el (varuga-insert-calendar-line): Support property parameters. (varuga-insert-calendar-event): Format ORGANIZER CN as property parameter. Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
-rw-r--r--varuga.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/varuga.el b/varuga.el
index 16c3f6e..2b6776d 100644
--- a/varuga.el
+++ b/varuga.el
@@ -75,9 +75,10 @@
(defvar varuga-time-format
world-clock-time-format)
-(defun varuga-insert-calendar-line (key value)
+(defun varuga-insert-calendar-line (key value &optional params)
"Insert ical calendar line.
-KEY is the name of the ical property and VALUE is its value."
+KEY is the name of the ical property and VALUE is its value.
+PARAMS is an alist of ical property parameters and their values."
;; Limit content line length to 75 octets as required by RFC 5545.
(let ((maximum-octets-per-line 75)
(octets-so-far 0))
@@ -95,8 +96,14 @@ KEY is the name of the ical property and VALUE is its value."
;; the folding space.
(setq octets-so-far (1+ (string-bytes str))))
(insert str)))
- (format "%s:%s"
+ (format "%s%s:%s"
(upcase (symbol-name key))
+ (seq-mapcat (pcase-lambda (`(,key . ,value))
+ (format ";%s=%s"
+ (upcase (symbol-name key))
+ value))
+ params
+ 'string)
value)))
(insert "\n"))
@@ -111,9 +118,9 @@ KEY is the name of the ical property and VALUE is its value."
(varuga-insert-calendar-line 'dtstamp
(varuga-format-time-string (current-time)))
(varuga-insert-calendar-line 'organizer
- (format "CN=%s:MAILTO:%s"
- (varuga-calendar-event-organizer event)
- (varuga-calendar-event-organizer-email-address event)))
+ (format "MAILTO:%s"
+ (varuga-calendar-event-organizer-email-address event))
+ `((cn . ,(varuga-calendar-event-organizer event))))
(varuga-insert-calendar-line 'dtstart
(varuga-format-time-string
(varuga-calendar-event-time-start event)))