From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [new exporter] 2 questions Date: Sat, 23 Feb 2013 13:36:27 +0100 Message-ID: <874nh3jjg4.fsf@gmail.com> References: <87sj4ogr4b.fsf@bye.fritz.box> <87liagjhlm.fsf@gmail.com> <87fw0oxhon.fsf@bye.fritz.box> <87hal4jfuf.fsf@gmail.com> <87a9qwni43.fsf@Rainer.invalid> <87ppzr5ms9.fsf@bzg.ath.cx> <877glzi9or.fsf@gmail.com> <87obfbw7kj.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9ELP-0000K2-D3 for emacs-orgmode@gnu.org; Sat, 23 Feb 2013 07:36:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9ELJ-00036J-95 for emacs-orgmode@gnu.org; Sat, 23 Feb 2013 07:36:47 -0500 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:63595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9ELJ-000366-2z for emacs-orgmode@gnu.org; Sat, 23 Feb 2013 07:36:41 -0500 Received: by mail-we0-f175.google.com with SMTP id x8so1257809wey.6 for ; Sat, 23 Feb 2013 04:36:40 -0800 (PST) In-Reply-To: <87obfbw7kj.fsf@Rainer.invalid> (Achim Gratz's message of "Sat, 23 Feb 2013 13:14:36 +0100") 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: Achim Gratz Cc: emacs-orgmode@gnu.org Achim Gratz writes: > Nicolas Goaziou writes: >> IMO the parser already DTRT. In which case do you think it doesn't? > DTRT is what you define as DTRT, so yes it does that already. At the > very least it would be nice if the parser warned when it finds stray > syntax pieces that are missing their match (it took me quite a while > to see what was going on). If I look at the buffer I see things > differently than the parser, The parser parses Org syntax. If you see something else, unless there is an obvious bug, then you are expecting the Org syntax to be different from what it is. It's even the goal of the parser: to define the way to read Org syntax. Actually it is very simple to understand: elements have precedence over objects. So in the following case: --8<---------------cut here---------------start------------->8--- xxxx xxxx x x xxxxxxxxxxxx xxxxx xxxx xxxxxxxxxxxxxxx xxxx xxxxxxxx xxxx x xxxx xx xx xx xxxxxxxxx xxxx xxxx x xx x x xx - item 1 - item 2 --8<---------------cut here---------------end--------------->8--- there's a paragraph followed by a plain list, no matter what is found within the paragraph. And it's still the case when we replace "x" with tricky contents like: --8<---------------cut here---------------start------------->8--- Some paragraph, something that looks like a link start [[#eisetu][and something that looks like a math snippet \(2 + 3 - item 1 - item 2 --8<---------------cut here---------------end--------------->8--- > so some way to ask what the parser thinks I'm looking at would be nice > (maybe that exists already, I don't know). Usually fontification is a good indicator. Unfortunately, Org fontification doesn't rely on the parser at the moment, so there are some discrepancies. Also, you're thinking backwards here: the parser doesn't have to think about what you're looking at, as it knows it. Alas it can't know what you're thinking you're looking at. Anyway you can use (org-element-context) to know where point currently is. > And in all these cases where something inside an object or an element > looks like it might be another element or greater element, we do need > a way of quoting, I'd say. No element can be found within an object. So far, I don't see a need for quoting. In your previous example, you know (or should know) that "- " as the first non-white string in a line defines an item. You keep wanting to see a mathematical operation, probably because you're focused on the LaTeX snippet you're writing, but you're wrong wrt Org syntax. Regards, -- Nicolas Goaziou