diff options
author | Jake Coble | 2025-06-07 18:26:55 -0400 |
---|---|---|
committer | Arun Isaac | 2025-06-08 03:07:59 +0100 |
commit | a50bd935df695e1f6e720761cba39c34af0c1cda (patch) | |
tree | b122b792548d2e74ea15e23f6c547eca82929423 | |
parent | 388f05f22a4498632ce16b4a8f49a46d109c62e4 (diff) | |
download | varuga-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.el | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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))) |