From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ferdinand Pieper Newsgroups: gmane.emacs.devel Subject: Re: Improving Emacs' iCalendar support Date: Wed, 23 Oct 2024 22:24:48 +0200 Message-ID: <87plnqpnxr.fsf@pie.tf> References: <87ed4dss2x.fsf@ohm.mail-host-address-is-not-set> <0bacd69a-7941-44d2-ac5e-3ae3f256481a@alphapapa.net> <87r08cqye8.fsf@ohm.mail-host-address-is-not-set> <87zfmwyoa9.fsf@localhost> <87bjzbp509.fsf@ohm.mail-host-address-is-not-set> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13108"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 23 22:25:53 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t3hvU-0003E8-M0 for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Oct 2024 22:25:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3huZ-000526-Qb; Wed, 23 Oct 2024 16:24:55 -0400 Original-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 1t3huY-00051y-Ts for emacs-devel@gnu.org; Wed, 23 Oct 2024 16:24:54 -0400 Original-Received: from nand.xyz ([2a03:4000:6:40c1::2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3huX-0007pV-Eh for emacs-devel@gnu.org; Wed, 23 Oct 2024 16:24:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nand.xyz; s=mail; t=1729715089; bh=tDf8w2mZPl9hZlSFAkw9o8KkKKNqBmkOnTqjJlUIzPs=; h=From:To:Subject:In-Reply-To:References:Date; b=uTbvMpf4rAWFm9ZJpYLLpVKtYldXB4bTVe48R+T1vpgeQMHDmWa2b3qwA4+lHY4gi +mo7DaFuRc/hMT98+hJSX4AeaJBNQtA3tBDWMUe7556+l6py1i39j61ROeuguGi+En H60eij4mdc6+LWTVhuPsUPrSIEhd6pMUNlczTpgU= In-Reply-To: <87bjzbp509.fsf@ohm.mail-host-address-is-not-set> (Richard Lawrence's message of "Wed, 23 Oct 2024 11:01:26 +0200") Received-SPF: pass client-ip=2a03:4000:6:40c1::2; envelope-from=ferdi@nand.xyz; helo=nand.xyz 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324806 Archived-At: (Resending just to list due to messed up spf entry; sorry for the trouble) Hi Richard, this effort to consolidate the iCalendar support is fantastic! Emacs is really lacking a central parser for iCalendar and a common internal representation of iCalendar items. I have ran over this several times, but was always very quick to shy away from working on a central overhaul of icalendar.el. I resorted to small extensions of gnus-icalendar.el to bring event (request) creation to gnus, which still is very much in a prototype state [1]. While I started extending the gnus-icalendar-event EIEIO class to support property parameters, it ended up being very cumbersome to create new event objects with all parameters correctly set. Richard Lawrence writes: > (icalendar-make-vevent > ;; properties: > (list (icalendar-make-property "DTSTART" > (icalendar-datetime-from-timestamp some-lisp-timestamp)) > (icalendar-make-property "DTEND" > (icalendar-datetime-from-timestamp some-other-timestamp))) > ;; subcomponents: > (list (icalendar-make-valarm ...)) > ...) > > > and get a struct back that you could then send directly to a function > like 'icalendar-print-component' or similar. Does that seem like a > reasonable approach, or is it already too cumbersome? (Would you prefer > e.g. to just be able to write the appropriate data structure as a > backquoted (p)list?) I think structs could be a good fit for the internal representation. Creating these from scratch should still be kept fairly straightforward for ease of use. There could also be a translation function that creates the appropriate struct from a very basic list representation like this: --8<---------------cut here---------------start------------->8--- (VCALENDAR ((PRODID nil "-//...") (VERSION nil "2.0")) (VEVENT (;; ... (DTSTART ((VALUE "DATE")) "20241201") (DTEND ((VALUE "DATE")) "20241231")))) --8<---------------cut here---------------end--------------->8--- Best, Ferdinand [1] https://git.nand.xyz/emacs/gnus-icalendar-request/ or mirrored at https://github.com/fpiper/gnus-icalendar-request