emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [parser] subscripts and underlines interacting badly
Date: Wed, 11 Dec 2013 21:55:59 +0100	[thread overview]
Message-ID: <8761qvxg2o.fsf@gmail.com> (raw)
In-Reply-To: <87haaf1bgi.fsf@gmail.com> (Aaron Ecay's message of "Wed, 11 Dec 2013 13:36:45 -0500")

Aaron Ecay <aaronecay@gmail.com> 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}

But that's not the real problem: whenever we change underline syntax
(e.g. if we implement escaped characters), we will start over again, as
more ambiguous cases might spawn.

> 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.

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 understand your point.  But I think there is a danger in some cases
> that the tail of “portability” 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'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.

> 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’s output* from having to worry about the value of the variables in
> question.
>
> Finally, it would allow the re-unification of the export and display
> flavors of the use-subscripts variable.  It’s 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.)

Note that in my post, I said "at the moment". There are two variables
for historical reasons. AFAIC some `org-export-with-*' variables don't
make much sense anyway (`org-export-with-tables' comes to mind, but also
`org-export-with-sub-superscripts').

The real question is: why would we need to disable superscript/subscript
in an Org document? We probably need it because they can get in the way
sometimes. Then, we'd better provide tools to put them out of that way
instead of completely disabling them. Character escaping is one
solution.

Again, I strongly think we should focus on making Org syntax simpler
(and yet powerful) instead of piling up variables to change it on the
fly for occasional needs.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2013-12-11 20:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11  2:30 [parser] subscripts and underlines interacting badly Aaron Ecay
2013-12-11  8:22 ` Nicolas Goaziou
2013-12-11 18:36   ` Aaron Ecay
2013-12-11 20:55     ` Nicolas Goaziou [this message]
2013-12-12  7:56       ` Aaron Ecay
2013-12-12 17:33         ` Nicolas Goaziou
2013-12-12 19:42           ` Aaron Ecay
2013-12-12 20:47             ` Nicolas Goaziou
2013-12-16  3:15               ` Aaron Ecay
2013-12-16  3:24                 ` [PATCH] quick patch to org-habit todo state keywords Ted Wiles
2013-12-16  4:27                   ` Aaron Ecay
2013-12-17 16:57                 ` [parser] subscripts and underlines interacting badly Nicolas Goaziou
2013-12-18  6:57                   ` Aaron Ecay
2013-12-18 15:01                     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761qvxg2o.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).