emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [BUG] Inconsistency in src block hiding


From: Nicolas Goaziou
Subject: Re: [O] [BUG] Inconsistency in src block hiding
Date: Tue, 24 Jan 2012 21:39:00 +0100

Hello,

Eric Schulte <address@hidden> writes:

> Nicolas Goaziou <address@hidden> writes:

> Changing the default drawer export behavior from "don't export" to "do
> export" would be surprising

Probably at first, but not for too long.

> would break many existing work flows

Not at all, since it's just a d:nil away from old behaviour.

Note that the current behavour is _not_ a d:t away from what I want to
implement. Indeed, even with d:t, you still need to change default
handler for drawers (org-export-format-drawer-function) as the default
one (org-export-format-drawer) will change drawer's contents into
a fixed-width area. For that task, an example block would have achieved
the same (hiding + verbatim).

> would likely make drawers less useful.

Certainly not, but I will that explain later.

> In general I think the Org-mode specification is best defined by how
> Org-mode is used and how it may be more easily and intuitively used in
> the future.  Org-mode doesn't currently have a formal specification, and
> I think that is a good thing.  Formal specification don't prevent bugs,
> they just move them from the code to the spec.

Then we may be running into problems, since my objective, with
org-element, is to provide a formal specification and normalization of
Org syntax. Along the way, some parts (hopefully few) in Org syntax will
need to be defined or re-defined.

Because only a very small number of persons can pretend to know every
part of Org syntax and even less (if any) to actually use them, we
definitely need guidelines to offer relevant future improvements.

Some current uses just don't fit in a global view: a recent example was
given by the caption syntax, which was heavily LaTeX oriented.

> To my mind a better path moving forward would be to change the behavior
> of the :RESULTS: drawer so that it is exported but *not* to change the
> default drawer export behavior.  This way with a :wrap header argument
> the code block results could be hidden with tab but would still be
> exported.
>
>    PRO: allows hiding code block results with tab, makes it clear where
>         results begin and end, uses drawers for hiding which is what
>         they are designed for, avoids the potential for hiding anything
>         with a name
>
>    CON: more syntactic weight around results, changes the existing
>         default behavior, makes the "RESULTS" drawer a special type of
>         drawer
>
> There is likely a better option but this is the best that comes to mind.
> Personally I am also content with the current behavior in which anything
> under a #+name: may be hidden.

Drawers should not add any semantics to the contents they are hiding.
They should be, as a default, neutral entities useful to hide stuff in
an Org buffer but certainly not to interfere with export.

1. There are already many ways to remove arbitrary contents from export.
   Among them, one can find the :noexport: tag, comment blocks...
   There's absolutely no need to add more.

2. They are better handled with regards to visibility cycling, which in
   not the case of single keywords. Allowing to hide every single Org
   syntax with a #+name: keyword could potentially be a mess.

3. By essence, drawers are better suited for hiding stuff than keywords,
   since they allow to group any number of elements, whereas keywords
   only apply to one keyword at a time.

4. Drawers are flexible. All major back-ends allow to configure
   behaviour of drawers with regards to export. You can always decide to
   keep :FOO: drawers transparent but remove any :BAR: drawer. It will
   be even simpler with the new export engine.

On the other hand, I don't think that adding another special type for
drawers is the way to go. In general, adding new syntax should be done
with parsimony. In this case, it unnecessarilyrestricts possibilities:
why enforce a special behaviour for :RESULTS: since (point 4) you can
choose it?

I still vote for neutral drawers.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]