From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WL3FLv1aDWVBUAAA9RJhRA:P1 (envelope-from ) for ; Fri, 22 Sep 2023 11:14:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WL3FLv1aDWVBUAAA9RJhRA (envelope-from ) for ; Fri, 22 Sep 2023 11:14:37 +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 69E08656C9 for ; Fri, 22 Sep 2023 11:14:37 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=hZj4aEwN; 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=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695374077; 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=q8Hg5K8Wvqq0+p5OVowHY9h+1hEWMxboj6q5hylsUsY=; b=CE1D5QV2JupVKYnsju0fpHj24sevouTknWAE7wZrC5kKd4gzpK0oNaQvjLZF3U2Eb5qxJ3 YXoy8AqKCtGMSKBLUpzN+c54Z+Ab5UQUr1uFNlmq+lgytQij/t8we970aEFWCb4a1kqPcf dn6bRWVJ2akRFxtFJE7xqbI1/qLWTaizfGvAFJD65uzvjU2OaHAp7S5W5ONBzhLZnAJnm1 RxHqOHyqXcDM/7VD++XbDsJsUM0u5FhWp9fbHe7DD2XDD6kZLzR2x9W5RwAKien/zAvrlz VIIW2VKzdLdteGDP4vaxVhOSfjWjO6EengJsU/nJOdyYSIgrcgnFJLfYxf0jAA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695374077; a=rsa-sha256; cv=none; b=sf0IxYRem++x78NYAVUyUTBpuKwjemSnZOBLKNR8maoONZWqwlJYgJaC5QEtFBiSoXlDfb hoNJr+fMPYJS8CeDjfiJ/Y0f6aAt/fRWFSmuBZ7PWZBWKUp1a9RY6fFpwnR9hB8DY9K5u1 K5BGjuUDl2DkjoKklBsfCipSZr4zmJLJuzKPV9pUdy0q4+JIDjEGwWZ1dCqtJWhLGSFv7m 2k3oWjA1tIlfbMSUlACV7mmnCvpc93J6YWCD+lTCofdaxL2HF4AQXLYdVHCmxdj/BUpg2Z wC5zkM2O6VKqhciE6LNWOia8sP078WTnQd0Ay7CAcXA+oswSEaquo0M81yTqcQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=hZj4aEwN; 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=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcDm-0006oV-De; Fri, 22 Sep 2023 05:13:10 -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 1qjcDf-0006nt-Tz for emacs-orgmode@gnu.org; Fri, 22 Sep 2023 05:13:03 -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 1qjcDd-0007S3-Je for emacs-orgmode@gnu.org; Fri, 22 Sep 2023 05:13:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 98157240103 for ; Fri, 22 Sep 2023 11:12:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695373978; bh=d9OVIlnkAKVQxm2Xvjg2XYP8o8HhASckwl7vZvw/rxc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=hZj4aEwNDrWWzmkux0+/ivrfJjROsVMfjnAnziSm1dQ2NH7vMGsYENH0LgYxH3s2J w4dNibYX/pX5Ns9VpFw6kIrBBh8y3eGAucXnojWYY7GJOFxbcdxli7IHCx4SLwZnT3 wTfe7oaGTB5wIxI2YFq85Exr0ysvi6nFKj47bi70qQcQSpI+wDEUj+JYuvjlL+4mAw rOQBaxBZpUKeDfO1mhQ8iNBFa4MqZuEg6LzS4q3h7S64PrYAnL3GbKzMbRa+/76DKp +KN/megJJaUOGDbN21zw/kyvhxODkG/4Kup79EwUUkdL7ZlyBzkwM/UZB2dV+ZLE++ KQcznvRmg8pHw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RsRPj6000z6v4B; Fri, 22 Sep 2023 11:12:57 +0200 (CEST) From: Ihor Radchenko To: Tom Alexander Cc: emacs-orgmode@gnu.org Subject: Re: Subscript with parenthesis In-Reply-To: <3cb9366e-7915-481d-be74-1953a8dd5847@app.fastmail.com> References: <3cb9366e-7915-481d-be74-1953a8dd5847@app.fastmail.com> Date: Fri, 22 Sep 2023 09:14:12 +0000 Message-ID: <875y42zi1n.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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 X-Spam-Score: -7.03 X-Migadu-Spam-Score: -7.03 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 69E08656C9 X-TUID: IqKDSzxNtjfI "Tom Alexander" writes: > Some additional things I'm noticing: > > - when using parenthesis, :use-brackets-p is nil, so they're not equivalent to curly braces. `org-element-subscript-parser' uses `org-match-substring-regexp', which indeed allows foo_(...). This is not documented in org-syntax.org and in the manual (12.3 Subscripts and Superscripts). > - it does not support objects inside the parenthesis, just plain text, which again means they're not equivalent to braces. Not true. I tried b^(*asd*) and bold inside superscript does get parsed. > - it, however, seems to require that the parenthesis are balanced because this test document does NOT contain a subscript: > ``` > foo_(b(ar) > ``` > which is closer to the curly braces requirement since that seems to be the only part of the subscript/superscript documentation that mentions needing balance. Yup - the regexp used is the same with what we do for curly braces: (defconst org-match-substring-regexp (concat "\\(\\S-\\)\\([_^]\\)\\(" "\\(?:" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)" "\\|" "\\(?:" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)" "\\|" "\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)") "The regular expression matching a sub- or superscript.") -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at