From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support) Date: Thu, 02 Jan 2025 18:03:31 +0000 Message-ID: <87msg9qej0.fsf@localhost> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18152"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Richard Lawrence Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 02 19:01:58 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 1tTPW9-0004Xx-PZ for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Jan 2025 19:01:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTPVe-00058Z-Mq; Thu, 02 Jan 2025 13:01:26 -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 1tTPVV-000586-Lk for emacs-devel@gnu.org; Thu, 02 Jan 2025 13:01:18 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTPVS-0004Fk-PU for emacs-devel@gnu.org; Thu, 02 Jan 2025 13:01:17 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8DBCA240101 for ; Thu, 2 Jan 2025 19:01:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1735840872; bh=7ZLkiqWe7dOFNwqLnfsGMjov+dMQmuiGEAkgOLPx+7E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=C0rgnR4VjqZ8SOyqD2tlWZqms6zN+JqCZ0z1hM97quW4StYRQnEQPItX8S7uaP2eS CeNhWacKRaNfyYkTmUiVJWE5t2S6hiRuRwSBCSJO3EiGWGw4I+FW9JMY7qzEuurd9A xdpXwM9n5toc1N7OviGSK3B7xLpz7WnI0X+kU9qovKtfw1OF9PdgxNQhalelJLzouG GR8eN8LC5QzlrbRE/nlMsWN8aVRSPEPC30gO031rE0LYj9AD9wCoJpsfy1pxqEJm5A vCz27413Rm8t67sG52eD+QFajd9jUAU1jtKzj9+tuJA12ryqNNsXwmmXmJ3p0kCzP+ Qb35xr5dIFfRg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YPDzC326lz9rxM; Thu, 2 Jan 2025 19:01:11 +0100 (CET) In-Reply-To: <87seq290b6.fsf@recursewithless.net> Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=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:327578 Archived-At: Richard Lawrence writes: >> Should be just >> (org-element-create type props contents) >> and then >> (org-element-contents new-node) > > That's what I would have thought. In my experiment, I have done this: > > (defun ical:make-ast-node (type &optional props &rest children) > ;; automatically mark :value as a seconary property for org-element-ast: > (let ((full-props (plist-put props :secondary (list :value)))) > (org-element-create type full-props children))) > > (so basically just aliasing org-element-create) and 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) This is a common pattern when passing argument to a function with &rest. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at