From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id EO8aBPDA1WQt6AAASxT56A (envelope-from ) for ; Fri, 11 Aug 2023 07:02:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2NoRBPDA1WSxyAAA9RJhRA (envelope-from ) for ; Fri, 11 Aug 2023 07:02: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 6F4974C785 for ; Fri, 11 Aug 2023 07:02:38 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fizz.buzz header.s=fm2 header.b="ieYnm/rN"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=Wzf5XjYb; 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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691730159; a=rsa-sha256; cv=none; b=OY8Fz7Hh2ZAiSJTRRzmOgOy2Ke5OabJioPvf76/wt9z6CfQgWjHepvrjtlHq5FAqSIcVn1 JzjtTOExlI+F6ulCp25lCtHtHSSVS9ryfnRCFnY3S3ujlNAk7vTukJm/52YrTOOFYYVfC6 qtPM592CBEcOG5nVhwJgpsK5WIuwj/8FAO+mmICekl6iZ1lJvV2i0+GDXEUbHyC9qk++y6 aEu9oFOKo8TWzj5Ejlwr4fyxrgecVstlqKziUJx9xEJsNJqWWUBQRdSj9UyHu8+5PpaZF5 LfXD/F0f9CshdCGHegczvQDKUbhsb8H0OvH2Vf4jnxDAXfoiHz/+uAkwPXt+QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691730159; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=1eHbNo3z0ssn+onJN5oxQtMquQ6KbCMdSauJKv8iink=; b=jAIcPeiOav2JTLAG6qRUg7rlw0opdtKcePJHBEP8F/XImXhv7wNpPrcq75rFnQ95N+m5BC +U9fjgImoQsZYSkG1p+pAiG/tj/REl+lnz0RBI+N/v8GUDEaw5GfpICKsNOWHfi87hzmCU o8RK6+TiAJ8aG/e7VxvM6rTQR22HQb0PVU/Va9fFqowKOj9Mf1JO61vckYzYbOcCOCB96o 9cNyrOPqEY+0c0QBXy67pTc/3riso0OH1NdGkItsIDkLwJqPAXsuEg5UZ/suZIkwI57ucO 25HX5LuDKuPohPObKILxYmVQDQA4I4IQRFZ7iMMKs5CHUEuPo++1gwrtHBh0uQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fizz.buzz header.s=fm2 header.b="ieYnm/rN"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=Wzf5XjYb; 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"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUKHA-0006LS-DF; Fri, 11 Aug 2023 01:01:28 -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 1qUKH4-0006L4-1D for emacs-orgmode@gnu.org; Fri, 11 Aug 2023 01:01:26 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qUKH1-0000UG-5s for emacs-orgmode@gnu.org; Fri, 11 Aug 2023 01:01:21 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id EFF155C0059 for ; Fri, 11 Aug 2023 01:01:16 -0400 (EDT) Received: from imap47 ([10.202.2.97]) by compute6.internal (MEProxy); Fri, 11 Aug 2023 01:01:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fizz.buzz; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1691730076; x=1691816476; bh=1eHbNo3z0ssn+onJN5oxQtMqu Q6KbCMdSauJKv8iink=; b=ieYnm/rNXTzNCVW5N4DSSJBDH2blvyIPKfTVxFGQY +bVolVDgfTHpeGQbdsUcixEPpreJjcD6JxR3mit5E7ma2nEeQBChDKqHRbWn1pLV S3Ye445BD8EwWp9XXHeJUZ2CrNOmslNGRQEc8EEx3KQyHVZk071SnDhyF9tUCKx3 y7IEK0IWj4Pp51JdWwDl/NSbVLF3fLTWr5cI33NXqwPgLPFoviMlYSb1lg0j9ZC/ ITaZCQq3Z45PPCON6Dr7cbzricEqnSZev038F9xiHJFkjD8h3079zfBS50JbWmMm S48mR0kRv25/yELhH/6DsCv6LZMBZIwTSNYPQHCkw4weg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1691730076; x=1691816476; bh=1eHbNo3z0ssn+onJN5oxQtMquQ6KbCMdSau JKv8iink=; b=Wzf5XjYbu+5PYRajKQtA+xYqJ9242dxRoRodh4juALYKPLnQbZ3 ZTqb47jUViX0HcSl6tex3GeWv4M8S3GbRyQbKztMsNRzQy+qlfG/HMWReG4sE7W0 v7S/A8bo/N/xApTtOTAVikFdS9ZapcBV+lD4hOhwPthjoGavFhJKFAH+V1muWpBZ HdKXxrmHzmlLfTPV55l2gnRZkWqZqf7eAnq5glwcGtXgUeOaV5ui/OSLvs0rCryI lUQOb2RzTDTSNqXEl+JHKlfKUoXvRwCRlrtMaCnY7We5fpKj6NlgASDWcfFUrU0t paVjxF160pdx65lfw+1Vcra62LZVSl0SvQg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrleejgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtredtre ertdenucfhrhhomhepfdfvohhmucetlhgvgigrnhguvghrfdcuoehtohhmsehfihiiiidr sghuiiiiqeenucggtffrrghtthgvrhhnpeekffehfeeigeeklefgjeeutdehfefgfeelfe euvdetvdegudetudeitefgheffteenucffohhmrghinhepohhrghhmohguvgdrohhrghen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohhmse hfihiiiidrsghuiiii X-ME-Proxy: Feedback-ID: i589b4368:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C8DB1A60077; Fri, 11 Aug 2023 01:01:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-Id: <6dd08eb7-9468-402d-bf88-eefb01442b99@app.fastmail.com> Date: Fri, 11 Aug 2023 01:00:56 -0400 From: "Tom Alexander" To: emacs-orgmode@gnu.org Subject: Seemingly inconsistent whitespace ownership Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.28; envelope-from=tom@fizz.buzz; helo=out4-smtp.messagingengine.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.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, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=1.999, PDS_OTHER_BAD_TLD=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.76 X-Migadu-Scanner: mx2.migadu.com X-Migadu-Queue-Id: 6F4974C785 X-Spam-Score: -4.76 X-TUID: gr78SMiQ/vhY The org-mode documentation states: "With the exception of list items, blank lines belong to the preceding element with the narrowest possible scope. For example, if at the end of a section we have a paragraph and a blank line, that blank line is considered part of the paragraph." https://orgmode.org/worg/org-syntax.html#org9bc833d So I created a test org-mode document with exactly that scenario described: ``` foo bar. * Lorem baz * Ipsum alpha beta ``` and then I ran a M-x eval-expression (message "%s" (pp-to-string (org-element-parse-buffer))) to see the parse tree. I'll paste the output at the end because its a wall of text, but analyzing it: The zeroth section has :begin at 1 and :end at 14, which is expected. Its only child is a paragraph which has a :begin at 1 and :end at 10, which only includes the line break at the end of "foo bar." but this is exactly the scenario described in the documentation (a paragraph at the end of a section) so I would expect the paragraph to end at 14, not 10. The "Lorem" section is repeating the test to prove this isn't behavior unique to the zeroth section. It behaved the same, so there is no need to go over it. The "Ipsum" section is where I put two separate paragraphs with a bunch of blank lines in between. This time the "alpha" paragraph goes all the way to character 48 which means it includes ALL of the blank lines between "alpha" and "beta". So the "Ipsum" section proves that ":begin" to ":end" is supposed to contain the trailing blank lines of an element. I am using org-mode version: Org mode version 9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/) And finally, that parse tree I mentioned: ``` (org-data (:begin 1 :contents-begin 1 :contents-end 53 :end 53 :robust-begin 3 :robust-end 51 :post-blank 0 :post-affiliated 1 :path nil :mode org-data :CATEGORY nil :granularity nil) (section (:begin 1 :end 14 :contents-begin 1 :contents-end 10 :robust-begin 1 :robust-end 8 :post-blank 4 :post-affiliated 1 :mode first-section :granularity nil :parent #0) (paragraph (:begin 1 :end 10 :contents-begin 1 :contents-end 10 :post-blank 0 :post-affiliated 1 :mode top-comment :granularity nil :parent #1) #("foo bar.\n" 0 9 (:parent #2)))) (headline (:raw-value "Lorem" :begin 14 :end 30 :pre-blank 0 :contents-begin 22 :contents-end 26 :robust-begin nil :robust-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 4 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#("Lorem" 0 5 (:parent #1))) :mode nil :granularity nil :parent #0) (section (:begin 22 :end 30 :contents-begin 22 :contents-end 26 :robust-begin 22 :robust-end 24 :post-blank 4 :post-affiliated 22 :mode section :granularity nil :parent #1) (paragraph (:begin 22 :end 26 :contents-begin 22 :contents-end 26 :post-blank 0 :post-affiliated 22 :mode planning :granularity nil :parent #2) #("baz\n" 0 4 (:parent #3))))) (headline (:raw-value "Ipsum" :begin 30 :end 53 :pre-blank 0 :contents-begin 38 :contents-end 53 :robust-begin 40 :robust-end 51 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 30 :title (#("Ipsum" 0 5 (:parent #1))) :mode nil :granularity nil :parent #0) (section (:begin 38 :end 53 :contents-begin 38 :contents-end 53 :robust-begin 38 :robust-end 51 :post-blank 0 :post-affiliated 38 :mode section :granularity nil :parent #1) (paragraph (:begin 38 :end 48 :contents-begin 38 :contents-end 44 :post-blank 4 :post-affiliated 38 :mode planning :granularity nil :parent #2) #("alpha\n" 0 6 (:parent #3))) (paragraph (:begin 48 :end 53 :contents-begin 48 :contents-end 53 :post-blank 0 :post-affiliated 48 :mode nil :granularity nil :parent #2) #("beta\n" 0 5 (:parent #3)))))) ``` -- Tom Alexander