emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [RFC] [PATCH] [parser] org-element.el: Handle block parameters
Date: Wed, 30 Oct 2013 18:23:34 -0400	[thread overview]
Message-ID: <87ob66bdp5.fsf@gmail.com> (raw)
In-Reply-To: <87iowfb325.fsf@gmail.com>

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 “Containers targeted at export back-ends” (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.

> 
>> 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’s author formatted nicely (on a new line preceded by a dash,
>> aligned to the right margin in text/html, using the csquotes package in
>> latex, etc.).  This patch would enable such a functionality.
>> 
>> #+begin_quote Chico Marx
>> Why a duck?
>> #+end_quote
> 
> Well actually, this kind of syntax is confusing at best. Something like
> the following could be used instead:
> 
>   #+begin_quote :author Chico Marx

That is a good idea.

> 
> Actually, there are two points to consider:
> 
>   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’m 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’m thinking specifically of
backends in contrib – certainly the core exporters for html, latex, and
plain text should move in tandem.  I’m 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.)

> 
>   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.
> 
>      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’s functionality
at the elisp level.  An “if you build it they will come” approach.  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’s 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’
configured export filters.

Aaron

(An alternative proposal which would work just as well – better even,
insofar as it applies to things other than special blocks – would be 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.)

-- 
Aaron Ecay

  reply	other threads:[~2013-10-30 22:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 19:04 [RFC] [PATCH] [parser] org-element.el: Handle block parameters Aaron Ecay
2013-10-29  8:20 ` Nicolas Goaziou
2013-10-30  4:28   ` Aaron Ecay
2013-10-30  8:01     ` Nicolas Goaziou
2013-10-30 22:23       ` Aaron Ecay [this message]
2013-10-31 11:00         ` Nicolas Goaziou
2013-10-31 18:15           ` Aaron Ecay
2013-10-31 19:08             ` 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=87ob66bdp5.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /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).