From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uJuYNkSrq2G9JwEAgWs5BA (envelope-from ) for ; Sat, 04 Dec 2021 18:54:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2KM8MkSrq2EffAAAB5/wlQ (envelope-from ) for ; Sat, 04 Dec 2021 17:54:12 +0000 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 73B571295 for ; Sat, 4 Dec 2021 18:54:12 +0100 (CET) Received: from localhost ([::1]:45048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtZEh-0004YY-JH for larch@yhetil.org; Sat, 04 Dec 2021 12:54:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtZDy-0004YN-CQ for emacs-orgmode@gnu.org; Sat, 04 Dec 2021 12:53:26 -0500 Received: from [2a00:1450:4864:20::32d] (port=56164 helo=mail-wm1-x32d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtZDw-0006b1-RZ for emacs-orgmode@gnu.org; Sat, 04 Dec 2021 12:53:26 -0500 Received: by mail-wm1-x32d.google.com with SMTP id p18so4911136wmq.5 for ; Sat, 04 Dec 2021 09:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E3BwKFdg8slhZDWIsIVwv/AtqgjxZtcqWFbPZP7wK/w=; b=Mgn9eWUhGLM7OwJm5mGePli6jt5hO/2MmT92cQlnrm/hYSR3SkGjSU1SFhKkZ9vjSz kk7qP/as1fmbEZJpyby3t+c2HGxTG4A44fe+ZRqypx6uff/6IB8oVInQOmFgVpVzi5dV uGiiDzMTcIeJxn84r34zBPMQHV1TbCoJjhoD8jnDcy75ninAdRLCyhOLFWKwwP5hvOTA jW9S6uaSwrw0zIoCtLDbfqHW0Hg3KM/FWls05X6aWmmX9qGApLJzwBP8wzGqIU2hWzS2 QB1qETwoIZzEzm1aw8UDMblXfR7twF1aGBpX6qbs3Pb/Fn40iGyHJ4xUwjW8JPoffRbt vQaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=E3BwKFdg8slhZDWIsIVwv/AtqgjxZtcqWFbPZP7wK/w=; b=zP6iCug8KonjECe6dOmJDnd3ZZ14bi4yXaMCCx1WJ8DKrRdyzeW8DfiTwlVOZuoUBE dLMJvWdvbc3/4be/49MXINmWpb4a9JM65QC7ti8WuJgErWYGfK1d5hs32F0ixydE5u70 QBU1tRouEEXkWHpUKoxskX225Vd2O1CjvGxprEm/uE00UlMpfOBhAm+7TZIdqMl7Oamo 2GnAmRQT/n7G+xsQU6xa8APwEY8i9zq77fggkwbZ9BtRIV2yA2m8c2OtCDFJLxbgN0Hu jcXxfH5OoF8NLMCBvuvizsxJVNpwyFKA4AoT2G60zW8iMVRnqVlIlnbAQ19NYaG21YTD FA3A== X-Gm-Message-State: AOAM530y1NujVcurDmNNqMYVTa95uj6jzqclwlV/467SyShwBYzlvB+I LVkcH4rMlW4jWEwbMlAMqfwlkCd4SmrgUcuBQ4vIF2JZbmA= X-Google-Smtp-Source: ABdhPJwekPNp5BZM0oxD7OrNz8h2z8PMHR86/ErKVSt0/FXfwpzUZ8x+LKupf3iwOb4MtGbHB82XTQwNs4HFjbRO1UI= X-Received: by 2002:a1c:4c19:: with SMTP id z25mr24547941wmf.177.1638640403276; Sat, 04 Dec 2021 09:53:23 -0800 (PST) MIME-Version: 1.0 References: <4897bc60-b74f-ccfd-e13e-9b89a1194fdf@mailbox.org> <87fsrbp673.fsf@gmail.com> <1ef0e093-c165-2a5f-954d-6a33b64c8ee9@mailbox.org> <87r1avgnpi.fsf@localhost> <878rx2bzhw.fsf@nicolasgoaziou.fr> <9525e029-a590-3f48-df64-ffb9176075d9@mailbox.org> In-Reply-To: <9525e029-a590-3f48-df64-ffb9176075d9@mailbox.org> From: Tom Gillespie Date: Sat, 4 Dec 2021 09:53:11 -0800 Message-ID: Subject: Re: Org-syntax: Intra-word markup To: emacs-orgmode Content-Type: text/plain; charset="UTF-8" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32d (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=tgbugs@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=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: , Cc: =?UTF-8?Q?Juan_Manuel_Mac=C3=ADas?= , Max Nikulin , Tim Cross , Denis Maier Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638640452; 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=E3BwKFdg8slhZDWIsIVwv/AtqgjxZtcqWFbPZP7wK/w=; b=DpzrueexDkscxPALHrdNYZ0KbRdrG1nUk9doOA5Ir0jcC6FfuXXtVTOsOVGmybP9ts5gLY NW9f+T9TIlrQ2wwCMq3qGc5KSCZF1gLTh0q8rbEylQx3V8N7u++US4L/SOkNDU4IOS6j0V EmB+X/3sE8XlwEhceu85919vxyphPr2O4VXQ33NP3bdT8sFGi0ojC+Nz3vwa5qdryjOoie +GPqhYdRiqpYxIX4TVeZ3o6TD7LdzMjC3KYe+4NsTje3MAAVnNs2bXgOaFlhV8s4OdCdZt LGZ66zMQlU7xUuGchlISfJU6ekC2iNAY8E1bp4YaPH1A6ueIFKOj9xdqJEsy2w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638640452; a=rsa-sha256; cv=none; b=ZfhhpBv0hJlMGrxB3gDQAW1eDodTnTEJJkzMV6Zqx7AF0/cmyP/+5iaySKqTyaK5qbwHLM 4BAOg0YQDipgNn6SpU3QwKz5kpq+5vljuPO5pFI8EYgTBclCUDof0MlEy5gxmPBdyP410F kMiY2A9HKquxwOTe4+ujRMkwmg5syTDZaNqVcNuO2Wt156bC7k16WHX7/5k4b62b3C4rSi kroE2Gr8RI5PPO2RH00zqvGco3FZiUKmyYcCR0zcgAnIqeI1w7YQIuUNxYb5Zm3T04Lnj3 rcKmkHmBD0UxspSKlUkGwjnUJwzHqBsfeQQ299DCg3tpD46QU+0ugVhbBKVKhg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Mgn9eWUh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: -1.83 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Mgn9eWUh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 73B571295 X-Spam-Score: -1.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: iu00ZnDQnpSH Hi all, After a bunch of rambling (see below if interested), I think I have a solution that should work for everyone. The key realization is that what we really want is the ability to have a "parse me separately" type of syntax. This meets the intra-word syntax needs and might meet some other needs as well. The solution is to make @@org:...@@ "parse me separately" block! It nearly works that way already too! To minimize typing we could have @@:...@@ the empty type default to org. This seems like a winner to me. The syntax for it already exists and won't conflict. It requires relatively minimal additional typing the implication is clear, and there are other places where such behavior could be useful. This syntax seems like a winner to me @@org:/hello/@@world @@:/hello/@@world You can also do things like #+begin_src org I want a number in this number@@org:src_elisp{(+ 1 2)}@@word! #+end_src Which would render to #+begin_src org I want a number in this number3word! #+end_src Thoughts? Best! Tom --------------- rambling below ------------- > This idea reminds me a bit of Scribble/Racket where every document is > just inverted code, which makes it possible to insert arbitrary Racket > code in your prose... I will say, despite some of my comments elsewhere, that I think exploring certain features of Scribble syntax for use in Org mode would simplify certain parts of the syntax immensely. For example various inline blocks are an absolute pain to parse because they allow nested delimiters /if they are matched/. The implementation of the /if they are matched/ clause is currently a nasty hack which generates a regular expression that can only actually handle nesting to depth 3. Actually implementing the recursive grammar add a lot of complexity to the syntax and is hard to get right. It would be vastly simpler to use Scribble's |<{hello }} world}>| style syntax and always terminate at the first matching delimiter. I'm sure that this would break some Org files, but it would make dealing with latex fragments and inline source blocks and inline footnotes SO much simpler. Matching an arbitrary number of angle brackets does add some complexity, but it is tiny compared to the complexity of enforcing matched parens and their failure cases especially because many of the places where nesting is required probably only see use of the nesting feature in a tiny fraction of all cases. One other reason why this is attractive is that all the instances where nested delimiters can appear on a line are preceded by some non-whitespace character. This means that using the pipe syntax does not conflict with table syntax! Now the question comes. If we could implement this for delimiters, could we also implement something similar for markup? The issue with the proposed markup outside delimiter inside approach is that it will change existing behavior for files that want the delimiters to be included in the markup, i.e. /{oops}/ becoming /oops/ is bad. A second issue is that putting the delimiter inside the markup cannot work for verbatim and code ={oops}= is ={oops}= no matter what. Therefore the solution is not uniform across all types of markup. We need another solution that works for all types of markup. What if we put the "start arbitrary markup" char outside the markup? Say something like |/ital/|icks? Or what if we went whole hog and used |{/ital/}|ics and made the |{...}| syntax trigger a generalized feature where the contents of the |{...}| block are parsed by themselves and can abutt any other text? This would be generally useful in a variety of situations beyond just intra-word markup. What are the issues with this approach? The first issue is that there is a conflict with table syntax if we were to use the pipe character because markup can appear at the start of a line. The second issue is that it might be confusing for users if |{}| also worked like {} when in the context of latex elements or inline src blocks, or maybe that is ok because |{}| never renders as text. Hrm. Ok. Second issue resolved, but what to do about the first? If we want generalized "parse this by itself" syntax so that we can write hello|{/world/}|ok, then we need a solution that can appear at the start of a line. So we can't use pipe because that is always a table line even if a zero width space is put before it ;). What other options do we have? How about #+|{/hello/}|world for the start of a line? As long as there is no trailing colon it isn't a keyword, so it could work ... except that if someone reflows the text and it is no longer a the start of a line then the syntax breaks. That is to say using #+| at the start of a line is not uniform, so we can't take that approach. What other chars to we have at our disposal? Hrm. How about @@? Could we use that? What happens if we use @@org:/hello/@@world? Or maybe if we want to minimize the number of chars we could do @@:/hello/@@world and have the empty prefix in @@ blocks mean org?