From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [parser] subscripts and underlines interacting badly Date: Thu, 12 Dec 2013 02:56:23 -0500 Message-ID: <87r49ik0qw.fsf@gmail.com> References: <87ppp415n4.fsf@gmail.com> <87bo0nu79v.fsf@gmail.com> <87haaf1bgi.fsf@gmail.com> <8761qvxg2o.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr18A-0002LJ-5j for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 02:56:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vr180-0002tE-LX for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 02:56:22 -0500 Received: from mail-qe0-x22d.google.com ([2607:f8b0:400d:c02::22d]:48146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr180-0002tA-IS for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 02:56:12 -0500 Received: by mail-qe0-f45.google.com with SMTP id 6so26679qea.4 for ; Wed, 11 Dec 2013 23:56:12 -0800 (PST) In-Reply-To: <8761qvxg2o.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou , "emacs-orgmode@gnu.org" 2013ko abenudak 11an, Nicolas Goaziou-ek idatzi zuen: > > Aaron Ecay writes: > >> I have found one case where both match, but an underline is intended. >> Are there any reverse cases, i.e. where both match but a subscript is >> intended? > > I don't know. Perhaps something as convoluted as: > > A'_{a_-1} Oh, yes. Very clever. Unfortunately, it means that a fix, even a temporary one, cannot be just to prioritize underline over subscript as I proposed. =3D/ > As a short term solution, it can be implemented (it's probably just > a matter of reordering successors calls). But in the long run, we really > need to define properly both syntax. I agree. Do you think it is possible to solve the problem while preserving the fact that underscore is used for both subscript and underline? It seems very difficult. When I think about the question, I think probably what is needed is a representation where object boundaries are delimited by one well-defined pair of delimiters, like {} in latex or <> in html (well, in html they delimit tags, but the principle is the same: only one pair). Then we don=E2=80=99t have to worry about escape syntax for many characters, or characters with multiple possible interpretations (or how many lines org-emph-re is allowed to match across, or ...). But that is just one idea I have had. You must have thought about it more, so maybe you have others. > > I'm strongly against behavioral parts in Org syntax (even though the > ship probably has sailed long ago). Org mode is bound to Emacs, but Org > format should be platform independent. Org syntax can be un-configurable even if org-element.el implements a (configurable) superset of it. Given that the use-subscript variable exists (and without taking into account more systemic solutions as discussed above), I=E2=80=99m arguing that it is cleaner to implement it in org-element, rather than in two separate places (in the regex-based old-style parsing code in org.el and in ox.el; there=E2=80=99s also one reference to the variable in org-table.el(!)) Phrased in other terms, it makes no sense (in the context of Org-Mode, not platonic Org Syntax) for org-element to insist that "a_b" is a subscript, if org-use-sub-superscripts =3D org-export-with-sub-superscripts =3D nil. Thanks, -- Aaron Ecay