From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uFQGOObrjmIfdQAAbAwnHQ (envelope-from ) for ; Thu, 26 May 2022 04:54:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id aOv2N+brjmKzgwEAauVa8A (envelope-from ) for ; Thu, 26 May 2022 04:54:30 +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 7A806F8F8 for ; Thu, 26 May 2022 04:54:30 +0200 (CEST) Received: from localhost ([::1]:41136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nu3ds-0002qY-Pc for larch@yhetil.org; Wed, 25 May 2022 22:54:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nu3dR-0002o9-58 for emacs-orgmode@gnu.org; Wed, 25 May 2022 22:54:01 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:42915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nu3dO-0003Ej-Rr for emacs-orgmode@gnu.org; Wed, 25 May 2022 22:54:00 -0400 Received: by mail-pf1-x42b.google.com with SMTP id y199so588096pfb.9 for ; Wed, 25 May 2022 19:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=qxRA8EWWCQ1FeA9qIAHijjHYMnAGxhmRq6EGMJZE9wQ=; b=LFT0flrOtyD0bDiCVN0cj8OjcPSUYBNe2P+tptO9rXUI/5S5VI4NHnn+tJwizpYeYj Cwu5MAQ6peedDYk6isVzvi2v5Z8wikvNsnQwnZM9fYaf6SVj5ACp6nBFouPVLunSJA8N P/spV63MBU+nyC049ES6YNe4JkYD7+VcbMKzDMKRmnN5qzdiuIMSAswBkm8Q/TuCf6zF 9YeDuc+i+cEMYMV7jPytXVMc1e2tlsDVurKCuKPsSXBI2QEqHyoTHyQL+ps8ZOkYNisj DgQhiEFL8BvJTXUAds3CTtXFasN8jA7rZ5b33+01plFbYgXA5uU4L5t8j1ZlloHm2SPB Hf9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=qxRA8EWWCQ1FeA9qIAHijjHYMnAGxhmRq6EGMJZE9wQ=; b=MuZoQbG9SyjEwaO5NbpE5vYMG31zqnHUCTQ4owqL9RPiVfYHKhnlo2WChHXDS+El6f cXafhB4hGg/5c04ZprE6zxHCDyXSVrO61PLRh2NTvuP+j9RUZXgJ6rB9z/uM/rPacyKw 2ThOU59Tz5yrLdpEmg/DmL13t7MSLSkf7yR4u1xubQjUVdUVlv1pUI8YmFrnoO9cCo8Q ru8FhQh5NIzTjyreVVzqngu8jYWZLzLgzbTfe1HyzXBQ30cGFIUWcJjgMywNaniheZn2 4dEaqJZP6A1SE8AvAnohBdufZH6bGH9dvw9HD7n5aO1g+6G82ngOfNuKH5QRklClrJk5 juxQ== X-Gm-Message-State: AOAM533OPvv6BxBQUwCZgiPl/Wys9F5fxUElPEqO4X7o+/CkLkczV+Lm arSqrJUlz9h9KcSApOqUsaQ8DQQyRph0Ew== X-Google-Smtp-Source: ABdhPJyb9I9h9tOcwCawfFGEVZndY5DXIIfuaN6bboyyMT833weY/StW/rDyuFSVlqRECl1wEDamSQ== X-Received: by 2002:a63:844a:0:b0:3f9:f00e:a4b0 with SMTP id k71-20020a63844a000000b003f9f00ea4b0mr20478080pgd.335.1653533635420; Wed, 25 May 2022 19:53:55 -0700 (PDT) Received: from localhost ([74.222.20.18]) by smtp.gmail.com with ESMTPSA id q22-20020a056a00089600b00518c3307266sm106556pfj.170.2022.05.25.19.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 19:53:53 -0700 (PDT) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Merging paragraphs separated by comment lines during export (was: About 'inline special blocks') In-Reply-To: References: <87czg49cwq.fsf@posteo.net> <87bkvn7iqn.fsf@gmail.com> <875ylvzio8.fsf@gmail.com> <87tu9e13ha.fsf@localhost> Date: Thu, 26 May 2022 10:54:34 +0800 Message-ID: <875ylt6m1h.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=yantar92@gmail.com; helo=mail-pf1-x42b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653533670; 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=qxRA8EWWCQ1FeA9qIAHijjHYMnAGxhmRq6EGMJZE9wQ=; b=aHXP850yMtihJanOpjR99QrgboSfoAjsxyUzBgHEu7iXqjogEqbnbkYtmywVnigjN+c/X2 foonrr6OZRkLQ9gZvTLU5h9LyEnmd2U5R1Yc+wMDyLhlJWSAM5VgtNcoklvRYO2xy41WCY S1mR7Q9UEdOYJ/asNLmtfZbLQNvfMhSv2JHpCiOsvWMT+lFi3hrJPsepn0IMj6Hfaq1BCu hw8kLDCwZHINnhq6WFf78A61bO+iOEzy0Yn8VFVP09ISemUDGJ3esHUVYGEXwWMhSUKZlU /B8KHdXBn+Bk/khxoDaeJP4b3JjEdihU1T2H1nVDC2KfhNn+/TEqxDW7MxGB6w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653533670; a=rsa-sha256; cv=none; b=EQwXwIBH04Z4leGcSGhBPz95T/jBAw/RRU2Alj9zcf94l5T2V8nJblmS7K8306o94NnEvZ a1Jn5rSv9FxSZGy1xX65lP4W7JMIsIxY0Ra4O6tT76VF7hP2AokjQqvE+/Ie6TFX7dO/br JwfoNvw9ayCot2dDsZvGCMPDa9uljlQHRqLiivFLI2Q+2TCVPDGe+kuGg9AJ7eeAU0IFgb lGWbOtPZ709+uiTTZdOppgFJUWmE8mSk0JXsGgnY278Aqa0k2P+1nnGWPRuR7ozjERFHlM 6pK/8nr2Bo1RkhFK5/i4r5igkwtnetEgp6R8v5O6x+YWIf9Z3bLvWtQNtlfjgg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LFT0flrO; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Spam-Score: -3.54 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LFT0flrO; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Queue-Id: 7A806F8F8 X-Spam-Score: -3.54 X-Migadu-Scanner: scn1.migadu.com X-TUID: p0oZZgewQjM/ Max Nikulin writes: >> First line >> # comment >> Second line >> >> Should we consider a comment as inline object? I suspect that such >> change will cause unpredictable breakages all around Org and third-party >> packages. > > I believed that comments are stripped before passing to export backend, > so I did not expect any problem with inline comments. You are right. After examining org-export--skip-p and org-export--prune-tree, I see that all the comments are removed unconditionally. But then, all we need to do is simply merging paragraphs separated by a comment with :post-blank = 0 and the first paragraph having :post-blank = 0. As long as export is concerned it is simply a question of writing an export filter (Timothy, did you have anything other than export in mind?) >>> ---- >8 ---- >>> #+macro: nofollow [[attr:(:html (:rel "nofollow noopener"))]] >>> >>> An {{{nofollow}}[[attr:(:html (:title "be >>> careful!"))]][[http://unsafe.com][unsafe link]]. >>> ---- 8< ---- >> >> I am not sure if I like this idea. It seems fine, but I afraid that it >> will complicate parser at some point. We may want to assign such inline >> properties to the following object, which is already a pain for >> affiliated keywords. > > Certainly parser should recognize inline attributes, but I do not expect > real complications here. Assigning attributes may be performed when AST > is ready. Just collect attributes and put them to the following > non-attribute object during breadth-first tree transversal. Attributes > as the last child is a reason for a warning. I was mostly thinking about element cache. Dealing with affiliated keywords caused a lot of pain when I was working on cache. On the other hand, inline objects are currently parsed together - org-element-context always parses everything starting from the parent object :contents-begin. So, maybe it is not going to be as much problem as I thought. Another concern about inline attributes is plain-text objects. Consider the following paragraph: Some text *bold* plain text. _Underline {{{attribute}}} more text /italics/ end of underline_. The object structure will be: (paragraph (plain-text "Some text ") (bold (plain-text "bold")) (plain-text " plain text. ") (underline (plain-text "Underline ") (attribute) (plain-text " more text ") (italics (plain-text "italics")) (plain-text " end of underline")) (plain-text ".\n")) So, should the attribute be assigned to " more text "? Just the next word? What if we have something like Text {{{attribute to be assigned to "two words"}}}two words but plain-text element still continues. Best, Ihor