From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YBr3KfBFb2RLGQAASxT56A (envelope-from ) for ; Thu, 25 May 2023 13:26:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kIy5KfBFb2RzbgAA9RJhRA (envelope-from ) for ; Thu, 25 May 2023 13:26:40 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 64AEB2E320 for ; Thu, 25 May 2023 13:26:40 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q296K-0007Lj-89; Thu, 25 May 2023 07:25:50 -0400 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 1q2960-0007KZ-W4 for emacs-orgmode@gnu.org; Thu, 25 May 2023 07:25:30 -0400 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 1q295q-00077p-4h for emacs-orgmode@gnu.org; Thu, 25 May 2023 07:25:27 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DA20F240101 for ; Thu, 25 May 2023 13:25:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1685013911; bh=rrdbhnvmV/KaEykMFR9yfgBPlkjrpJD0uQWczY5zDHY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=PXDYGRvhkrEr27XJckkv6uPVKs11ggcFbb7SpfhutAVuWPmkxRj4s2T2tG8j9HnSw SPfrH+yPG7VgpWpX1gnhrqejQWX0U1QWLXyOR/fIwzWYNz+eSWjXy4nE3QqSm0e3p7 QBSnJDX/k5ETUYjrqo6cJssIVs528/Czlii7JttS8zAPEyavOZ3AsnbBRTndC97PyT Cxcrl3m3ZVlSDhpXETNhrcV1DcYiQVnGilADazUxNO60Aw9BBNT1RHjvpcrPmlyMvf 2hSmTNINOFMx71MtGUyN35hHpx2psJWnDw7wNObnCgYjQkwQhVowTDUPZTIdbPTDiB S+72lDggcQQYg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QRm1g3Lb8z6tx4; Thu, 25 May 2023 13:25:11 +0200 (CEST) From: Ihor Radchenko To: bvchgvbt@mail.com Cc: orgmode ml Subject: Re: Modifying the parse tree In-Reply-To: References: <87wn0wwugx.fsf@localhost> Date: Thu, 25 May 2023 11:29:21 +0000 Message-ID: <87o7m8wsxa.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685014000; a=rsa-sha256; cv=none; b=moyFMz/w52Ticzpadn2mJVFxRUY5OI/4k45Afq+zhWp3Ez0JoEFZb5KbeWITdd9nF7nHCz mGjZ5qQphL1Cj6XCxkwFiRLe/nHTB5+P1iKuv9FCiryTmoWRkA2zwb9+57CMmSzm/Rl/nl ss0F5u4ZYcm0SvHPLTALAJ2YomwvwKhIdSNY71hO7BF5rnRg5s7Tl0AlmL7Ex/4adqmR16 Uo0wc35EqiE+bUe7i53EJe1ileGmkwPtXLti3b7o1Nfh76gKomkVLV6OTtxcJG4VGLldCT GemrRC0K6VVJChZHTT8SGVS9rjfnMN73KeApiXp7pYF9rqOxlEFxQ5ruadvqOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=PXDYGRvh; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1685014000; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+kc8zYCampPOAqf7ZDs4x2YrNvYpHw1570d5fGBfQ7A=; b=Obkc4xlLfqWtcTrdPgJJWewQjj4UzxIikSZkO65WINTK/yPOMQJno52AP8FABg/sbCDHye uAfwMXE5yvxKZDzQioKZ3Ry9L1Hsardb0CMFrgHBhaJ3omRxB4wFUvPWjLakxVm1AQNyhP wYtxRGaiOmFvEI15Z0iJbl9Q7whksTpuyssprn1UPYdB5HJ146Yg7zMAXF5rdd/xQyfaHF iOC8uPJaVQNqw2TUPSSaCHZB/TtSAouHj4CjwXNJPopyyONd+iPVCDRbacDdXnkP6jFDco aZGbjx97VYp9f6QY+BmUSx5Yo/AnqCJMm7fKpM3RkiMf3btxTm8QJOts5fRqRA== X-Migadu-Spam-Score: -9.57 X-Spam-Score: -9.57 X-Migadu-Queue-Id: 64AEB2E320 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=PXDYGRvh; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-TUID: 80Ayb3Uvyqyc bvchgvbt@mail.com writes: >> But be aware >> that interpreted tree and the original text do not have exact 1-to-1 >> equivalence. Some whitespace might be lost. > > Only whitespace? I can live with that. I know for sure about whitespace. We have some tests for interpreter, but this has never been tested thoughtfully for the use cases like yours. Should be mostly fine though, except some edge cases that you can report as bugs. The original aim of `org-element-interpret-data' is creating equivalence between the parse tree and the buffer text. >> > "org-element-headline-interpreter: Wrong type argument: wholenump, nil" >> >> Which implies that you added invalid headline element to the tree. > > Hmm. Does > headline (:title hello :todo-keyword TODO :todo-type todo) > look valid to you as a minimal TODO-type headline? Created via: > > (let ((todo (org-element-create 'headline))) > (org-element-put-property todo :title todo-title) > (org-element-put-property todo :todo-keyword "TODO") > (org-element-put-property todo :todo-type "todo")) Yes, it is invalid. You must always have :level. You might try https://github.com/ndwarshuis/org-ml, though I plan some breaking changes affecting org-ml soon. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at