From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Lawrence Newsgroups: gmane.emacs.devel Subject: Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support) Date: Thu, 02 Jan 2025 21:01:15 +0100 Message-ID: <871pxlhto4.fsf@recursewithless.net> References: <87ed4dss2x.fsf@ohm.mail-host-address-is-not-set> <87mshq9w5c.fsf@ohm.mail-host-address-is-not-set> <86ed31j6zk.fsf@gnu.org> <87ldx9vsnb.fsf@localhost> <868qt8kj6f.fsf@gnu.org> <87ikscx5io.fsf@localhost> <867c8skhy6.fsf@gnu.org> <87frngx4fx.fsf@localhost> <864j3wkczm.fsf@gnu.org> <87cyhg0zjz.fsf@localhost> <87ttamtf7g.fsf@recursewithless.net> <87h66l2isk.fsf@localhost> <87cyh8guci.fsf@recursewithless.net> <87r05mg9ve.fsf@localhost> <87seq290b6.fsf@recursewithless.net> <87msg9qej0.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18562"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 02 21:02:03 2025 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 1tTROL-0004cJ-Dx for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Jan 2025 21:02:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTRO5-0008Kl-Jz; Thu, 02 Jan 2025 15:01:49 -0500 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 1tTRNu-0008Ff-7T for emacs-devel@gnu.org; Thu, 02 Jan 2025 15:01:37 -0500 Original-Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTRNp-0006V2-Sc for emacs-devel@gnu.org; Thu, 02 Jan 2025 15:01:34 -0500 Original-Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 5A93F2540133; Thu, 2 Jan 2025 15:01:25 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Thu, 02 Jan 2025 15:01:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= recursewithless.net; h=cc:cc:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1735848085; x=1735934485; bh=sdKBFqmdjtonSXmEeC4ngwP5kulRR3/vJg6WonJaCBk=; b= MV2+iIyVHUk13LUvL5/J7yDFbvtDXWIoO+HdskTo+DMfVVR2JRyjwk7M4KBxPvrA cy0JnrE0pvPDD9MmJKl4sBKJZDcQdeFO5RicKMsH7o7P1zm9fUCSlQoZaycJ69GX oMlPkeq3JPo7c+pBI9M00g9dDmSyynY8ZsEuWr8wRTaHPs81IlvAaTkeTcjdH1nS zA0IpZYUT1KCiHod2a9qzbphrzJKwDjVXDV+4CNfJd2p99xp9/NdGtGRjsgVM9vT ylWJMh8x3msxWNA5a2ZjCW9aS+DeahIf4RoHJlEHm66GxtaWGOGt1EhNxplTrPkO MjQYuOfFsqXmki2AEYOljA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1735848085; x=1735934485; bh=sdKBFqmdjtonSXmEeC4ngwP5kulRR3/vJg6 WonJaCBk=; b=pNNLv9CtTEl6las8uvJkewb9Q+aT4pUouixBXbw+G0I7zuK/w5o No0xmMIuhUH04fXXwuXxlZvAb6eTrHPVDq6R1DmTytNA19ax/AgQB7o2qPogLezI LGbBbztJS/uRSdfVe+vzpQn/A4pf+k00ammXuCeUIGcOSPcA5IU7O4DhOUN9XFUS diIFW7Z19wPeiL3ncgxp3sgha4gHWqfMq7lYLaw2gsJRHduzfDxYf0tWfOhG/8XA auF6HRywHTrRDgBuaZDmm+MWJwcpaCUSYhNL7tw5gY0CDnItZ6qDP4rj091GXswP u3FKyJHIgEAgpfwx4ugnt4y8OT0W6SRFQjw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudefvddgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvve fujghffffkgggtsehttdertddttddtnecuhfhrohhmpeftihgthhgrrhguucfnrgifrhgv nhgtvgcuoehrfihlsehrvggtuhhrshgvfihithhhlhgvshhsrdhnvghtqeenucggtffrrg htthgvrhhnpeefueffvdeffeeftdeutdfgjeettdduveduudefjedtkeejgfehhedvgffg ffduhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrfihlsehrvggtuhhrshgvfihithhhlhgvshhsrdhnvghtpdhnsggprhgtphhtthhopedv pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeihrghnthgrrhelvdesphhoshhtvg hordhnvghtpdhrtghpthhtohepvghmrggtshdquggvvhgvlhesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: if7394488:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Jan 2025 15:01:24 -0500 (EST) In-Reply-To: <87msg9qej0.fsf@localhost> Received-SPF: pass client-ip=202.12.124.156; envelope-from=rwl@recursewithless.net; helo=fhigh-b5-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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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:327589 Archived-At: Ihor Radchenko writes: > That's not what you did. > You did not replicate the calling convention > (org-element-create 'type properties '( ...)) > > (ical:make-ast-node 'test nil '("a" "b" "c")) > > will have CHILDREN = '(("a" "b" "c")) > and pass this argument to `org-element-create' that will faithfully > create a node with a single child - anonymous node ("a" "b" "c"). > > You should do > > (apply #'org-element-create type full-props children) D'oh. You're right; sorry for the noise. In fact, I had already tried that in a previous iteration, but it didn't fix the issue(s) I was seeing in the tests and so I had already backpedaled on it by the time I wrote my previous email. I think this bit of the docstring had convinced me by that time that calling org-element-create via apply wasn't necessary: > When CHILDREN is a single anonymous node, use its contents as children > nodes. In any case, the issue with passing nil as the &rest argument is what causes most of the tests to fail. This remains so even once I change the call to use (apply #'org-element-create ...) as you suggested. This *is* documented in the Elisp manual, and I guess it makes sense, but I still find it somewhat unintuitive to reason about. So again, at least for all my uses, an additional/alternative interface to org-element-create that doesn't make children a &rest argument would be useful. I had hoped I could just make ical:make-ast-node an alias of org-element-create, but for now I will leave it as a wrapper around org-element-create with a different calling convention. Otherwise, I haven't run into anything that would prevent me from using org-element-ast and I'd be happy to use a more general version of it in icalendar-ast.el. Thanks for your help! Best, Richard