From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [parser] subscripts and underlines interacting badly Date: Wed, 11 Dec 2013 09:22:04 +0100 Message-ID: <87bo0nu79v.fsf@gmail.com> References: <87ppp415n4.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]:48784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vqf3K-0001rB-H8 for emacs-orgmode@gnu.org; Wed, 11 Dec 2013 03:22:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vqf3C-0004yz-3M for emacs-orgmode@gnu.org; Wed, 11 Dec 2013 03:21:54 -0500 Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]:47660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vqf3B-0004yv-SQ for emacs-orgmode@gnu.org; Wed, 11 Dec 2013 03:21:46 -0500 Received: by mail-ee0-f43.google.com with SMTP id c13so2700912eek.2 for ; Wed, 11 Dec 2013 00:21:44 -0800 (PST) Received: from selenimh ([91.224.148.150]) by mx.google.com with ESMTPSA id e3sm50663854eeg.11.2013.12.11.00.21.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Dec 2013 00:21:43 -0800 (PST) In-Reply-To: <87ppp415n4.fsf@gmail.com> (Aaron Ecay's message of "Tue, 10 Dec 2013 21:30:07 -0500") 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: "emacs-orgmode@gnu.org" Hello, Aaron Ecay writes: > I have encountered two related misbehaviors in the parser/exporter. > > The first manifests if you type the following line into an org-mode > buffer and execute M-: (org-element-context) with point on the =E2=80=98f= =E2=80=99; the > result is a subscript object, whereas I would have expected an > underline: > > '_foo_ > > I think both possibilities are returned by > org-element--get-next-object-candidates, and subscript =E2=80=9Cwins=E2= =80=9D because it > precedes the other in the list. I=E2=80=99m not sure how this should be > addressed, but maybe Nicolas knows. 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. This is usually not noticeable because, I think, most uses of underline begin with a space (e.g. some _word_) whereas subscript cannot. This is not true in your example. This has been discussed some months ago, but, AFAIR, no answer was found. Note that I suggested a change to superscript/supscript a couple of weeks ago, but it won't solve the problem at hand. Perhaps it could be extended to remove ambiguity for subscript. > I encountered the second issue when trying to hack around the first by > setting org-use-sub-superscripts to '{}. It seems this variable is not > considered by the parser. I think the attached patch fixes this > issue. Thanks for the patch. Though, the parser ignores `org-use-sub-superscripts' on purpose. At the moment `org-use-sub-superscripts' is a display variable only. 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'. 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). Regards, --=20 Nicolas Goaziou