From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [RFC] [PATCH] [parser] org-element.el: Handle block parameters Date: Wed, 30 Oct 2013 18:23:34 -0400 Message-ID: <87ob66bdp5.fsf@gmail.com> References: <1382987074-19223-1-git-send-email-aaronecay@gmail.com> <878uxca3p6.fsf@gmail.com> <8738njcrgl.fsf@gmail.com> <87iowfb325.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]:40656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbeAy-000696-Jb for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 18:23:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbeAq-0001RT-6T for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 18:23:44 -0400 Received: from mail-qe0-x22e.google.com ([2607:f8b0:400d:c02::22e]:41467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbeAq-0001RJ-11 for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 18:23:36 -0400 Received: by mail-qe0-f46.google.com with SMTP id s14so1255226qeb.19 for ; Wed, 30 Oct 2013 15:23:35 -0700 (PDT) In-Reply-To: <87iowfb325.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, 2013ko urriak 30an, Nicolas Goaziou-ek idatzi zuen: > IIRC, I already suggested a solution with Babel for this problem. > There's no need to complicate core Org syntax for such a specific > case. And I already said why I disagree that your proposal is a solution. Special blocks are =E2=80=9CContainers targeted at export back-ends=E2=80= =9D (according to the manual). Is it appropriate for such containers to have metadata attached? As I explain below, I think so. Whether you approve or disapprove of the use to which someone puts that metadata in a specific instance is a different question, as long as we agree that the metadata is potentially useful for some things. >=20 >> I also think it would be nice for the org code following this paragraph >> to be translated to output that makes sense for each backend, with the >> quote=E2=80=99s author formatted nicely (on a new line preceded by a das= h, >> aligned to the right margin in text/html, using the csquotes package in >> latex, etc.). This patch would enable such a functionality. >>=20 >> #+begin_quote Chico Marx >> Why a duck? >> #+end_quote >=20 > Well actually, this kind of syntax is confusing at best. Something like > the following could be used instead: >=20 > #+begin_quote :author Chico Marx That is a good idea. >=20 > Actually, there are two points to consider: >=20 > 1. Providing something like :author implies that all back-ends in core > and contrib and the manual have to be updated accordingly. Yes, that is desirable eventually. I guess whoever implements :author for quotes (maybe it will be me) will need to think about all these things. (Though I=E2=80=99m not sure that all backends have to be updated = in one fell swoop. The old behavior is still fine as a fall-back until all backends catch up to the new standard. I=E2=80=99m thinking specifically of backends in contrib =E2=80=93 certainly the core exporters for html, latex,= and plain text should move in tandem. I=E2=80=99m not sure there is any single person who knows the details of all the available export formats well enough to make a change like this across all of them.) >=20 > 2. "parameters" is too vague to be useful. It needs to be parsed > further, which means that we must define explicitly use cases and > keywords. Thus, I don't think adding "parameters" to every block is > a good move if we don't know beforehand how they will be used. >=20 > Though, it is possible to extend the syntax to well-defined > specific cases. :author may be one of them, there are certainly > others. I have the opposite view. The parser should provide a set of convenient tools to elisp code, which are useful for extending org=E2=80=99s functiona= lity at the elisp level. An =E2=80=9Cif you build it they will come=E2=80=9D ap= proach. One very successful recent example of this is the attr_backend syntax. This allows specifying data in a very open-ended format to export backends. I think people (including me) have been able to take advantage of this fact to incrementally improve export backends. Importantly, it was not necessary to define beforehand what keys and values are available in attr_backend lines. There is just free-form data, which anyone=E2=80=99s lisp code can hook into for whatever purpose. = If such an addition is useful and general-purpose enough, it can be added to the official export backend; otherwise it just lives in users=E2=80=99 configured export filters. Aaron (An alternative proposal which would work just as well =E2=80=93 better eve= n, insofar as it applies to things other than special blocks =E2=80=93 would b= e to provide a backend-agnostic #+attr: syntax (maybe with a different name, to avoid clashing with export-specific #+attr_foo). The :author information (for example) could then be put there. But I shaped this proposal based on what was already present in the documentation.) --=20 Aaron Ecay