From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [parser] subscripts and underlines interacting badly Date: Wed, 11 Dec 2013 13:36:45 -0500 Message-ID: <87haaf1bgi.fsf@gmail.com> References: <87ppp415n4.fsf@gmail.com> <87bo0nu79v.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]:32813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqoeQ-0007R4-Bn for emacs-orgmode@gnu.org; Wed, 11 Dec 2013 13:36:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqoeO-0003eJ-Gl for emacs-orgmode@gnu.org; Wed, 11 Dec 2013 13:36:50 -0500 Received: from mail-qe0-x231.google.com ([2607:f8b0:400d:c02::231]:48392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqoeO-0003eC-Cg for emacs-orgmode@gnu.org; Wed, 11 Dec 2013 13:36:48 -0500 Received: by mail-qe0-f49.google.com with SMTP id w7so5635980qeb.36 for ; Wed, 11 Dec 2013 10:36:48 -0800 (PST) In-Reply-To: <87bo0nu79v.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" Hi Nicolas, Thanks for your comments. 2013ko abenudak 11an, Nicolas Goaziou-ek idatzi zuen: > Actually, this is not really a parser problem but a syntax one. > underline and subscript are ambiguous, and therefore ill-defined, > because, in some situations, both can match at the same location. 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? The closest I could come up with would be something like: The quantities X_1 and X_2 are .... But I think, at least with default values of org-emphasis-regexp-components, this cannot be an underline. So, if there are indeed no such cases, the fix is just to always choose the underline, when both underline and subscript match at the same position. >=20 > Thanks for the patch. >=20 > Though, the parser ignores `org-use-sub-superscripts' on purpose. At the > moment `org-use-sub-superscripts' is a display variable only. >=20 > This change happened in 8.0. This also explains why > `org-export-with-sub-superscripts' is now a separate value from > `org-use-sub-superscripts'. >=20 > The main reason for this change is that I think that customizable > syntax, unlike to customizable behaviour, is not a good idea for Org > (e.g. portability and simplicity issues). I understand your point. But I think there is a danger in some cases that the tail of =E2=80=9Cportability=E2=80=9D will wind up wagging the dog= of org-mode. The syntax of org is an abstract mathematical object; the parser is just one (currently the only, AFAIK) implementation of it. So, if it proves necessary, some behavioral aspects can be added to the parser, as long as it is understood that they are behavioral and not driven by the abstract syntax (we could add such a comment to my patch, for example). I think it is advantageous to do so in this case. In the example I gave, two core parts of org (display and export) differ in their interpretation of the same string. Putting this behavior in the parser will fix that. It will also free future elisp code which consumes the parser=E2=80=99s output* from having to worry about the value of the variab= les in question. Finally, it would allow the re-unification of the export and display flavors of the use-subscripts variable. It=E2=80=99s hard to think of a use case that would want subscripts to be interpreted differently for display and export. (Although if someone has such a case, the unification need not be undertaken: it is purely optional.) Thanks again, --=20 Aaron Ecay