[O] [babel] Purpose of :results raw

2013-04-21 Thread Samuel Wales
[headers were somehow set to other than the mailing list itself.
maybe a gmane bug?]

On 4/20/13, Nicolas Goaziou  wrote:
> I will slowly integrate org-element-at-point in core interactive
> functions, like visibility cycling. Though, fontification will have to
> wait, because the parser isn't ready for that yet.

In the grand scheme, this might be a minor point, but:

While consistency is a good thing, I am nevertheless glad for that
last point.  I am concerned that incorporating the parser into
fontification will break inline footnotes that have more than one
paragraph (unless it is designed to be flexible enough to allow that).

To me, paragraphs naturally fit in inline footnotes, just as they do
in non-inline ones, but that is incompatible with the current parser,
which treats paragraphs as semantically larger units than inline
footnotes.

I appreciate your workaround for making them work again in export,
which works.  Fontification currently works perfectly also as it
always has; I just don't want that to stop working for those who, like
me, use inline footnotes similarly to non-inline ones, occasionally
with more than one paragraph.

This of course leaves us open to the accusation that nobody should be
so long-winded in a footnote as to have more than one paragraph (and
quotes and more, which currently work perfectly, ), but the same
would apply to non-inline footnotes also, and Org is in any case by
tradition highly flexible.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is NO hope without action.  This means YOU.



Re: [O] [babel] Purpose of :results raw

2013-04-20 Thread John Hendy


On Fri, Apr 19, 2013 at 5:27 PM, Nicolas Goaziou  wrote:
>
>
> Hello,
>
> "Sebastien Vauban"
>  writes:
>
>> Now that ":results drawer" has been introduced, I wonder why we still have
>> ":results raw".
>>
>> As once stated in this ML:
>>
>>  The sole purpose of raw results is to allow inserting an headline (I 
>> mean
>>  a real headline, not comma protected) in the buffer, because headlines
>>  cannot be contained in anything else than headlines.
>>
>> But drawer does the same.
>
> What makes you think drawers do the same? Drawers cannot contain
> headlines.
>

But back to the original question, what does =:results raw=
accomplish? From my view, even if they *can* contain headlines, they
get exported twice, and re-running the code block just adds duplicate
output to whatever was already there. Consider this test file:

#+begin_src orgmode

* Heading

#+begin_src R :session r :results output raw :exports results

cat("* Heading2\n")
cat("This is some test text\n")

#+end_src

#+RESULTS:
* Heading2
This is some test text

#+begin_src R :session r :results output drawer :exports results

cat("* Heading3\n")
cat("This is some test text\n")

#+end_src

#+RESULTS:
:RESULTS:
* Heading3
This is some test text
:END:


* Heading 4

#+begin_src R :session r :results output drawer :exports results

cat("This is some test text\n")

#+end_src

#+RESULTS:
:RESULTS:
This is some test text
:END:

#+end_src

"** Heading2" gets exported twice, and the :RESULTS: and :END: drawer
property indicators are also being exported. Yes, I can delete the
=:results raw= output, but that's time consuming, especially as one
tweaks code and re-evaluates to check the results. One has to do this
every time not to flood the document with duplicate results.

See Eric Schulte's response here:
- http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01224.html

I was getting multiple instance with =:results output raw= and was
instructed to use =:results output org= for the very reason that it
would be able to discern the output and replace it upon subsequent
block evaluations.

Now consider this recent thread:
- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg70016.html

The gist of that long discussion is that =:results output org= was
replaced by =:results output drawer=, but it seems we haven't
recreated all of the existing functionality. There's another thread
out there in which for a while it was to be =:results output wrap=
and/or =:wrap org= in order to do something like this (output actual
Org-mode syntax from a code block and have it exported as if it was
actually written in the document).

There are instances where I'd like to generate numerous plots and then
create subheadings for the various iterations of my loops, so having
the ability to actual print "** Subheading" to a results block and
have it exported would be useful. Seems that =:results raw= is now the
only way to do that, and export only works if you delete whatever
results are down there already prior to doing so.

Let me know if there's another/better way.


Thanks,
John

>
> Regards,
>
> --
> Nicolas Goaziou
>
>




Re: [O] [babel] Purpose of :results raw

2013-04-20 Thread Nicolas Goaziou


Hello,

"Sebastien Vauban"
 writes:

> The fact that the following output a normally behaving headline[1], AFAICS.
>
> #+begin_src sh :results drawer :exports both
> echo "* Unescaped headline"
> #+end_src
>
> #+results:
> :RESULTS:
> * Unescaped headline
> :END:
>
> Though, effectively, when exported, it's not right:

[...]

> Do you mean it, because of the wrong export?  By wrong, I don't mean "buggy",
> but "not foreseen as I (= me) thought".

Both cycling mechanism and fontification are bad indicators about the
syntax at point. Use either `org-element-at-point' or
`org-element-context' to know what is really parsed, according to the
Org syntax.

I will slowly integrate org-element-at-point in core interactive
functions, like visibility cycling. Though, fontification will have to
wait, because the parser isn't ready for that yet.


Regards,

-- 
Nicolas Goaziou




Re: [O] [babel] Purpose of :results raw

2013-04-20 Thread Sebastien Vauban
Hello Nicolas,

Nicolas Goaziou wrote:
> "Sebastien Vauban" writes:
>
>> Now that ":results drawer" has been introduced, I wonder why we still have
>> ":results raw".
>>
>> As once stated in this ML:
>>
>>  The sole purpose of raw results is to allow inserting an headline (I
>>  mean a real headline, not comma protected) in the buffer, because
>>  headlines cannot be contained in anything else than headlines.
>>
>> But drawer does the same.
>
> What makes you think drawers do the same?

The fact that the following output a normally behaving headline[1], AFAICS.

--8<---cut here---start->8---
#+begin_src sh :results drawer :exports both
echo "* Unescaped headline"
#+end_src

#+results:
:RESULTS:
* Unescaped headline
:END:
--8<---cut here---end--->8---

Though, effectively, when exported, it's not right:

--8<---cut here---start->8---
\lstset{language=sh,numbers=none}
\begin{lstlisting}
  echo "* Unescaped headline"
\end{lstlisting}

:RESULTS:

\section*{Unescaped headline}
\label{sec-7}
:END:
--8<---cut here---end--->8---

as ":RESULTS:" and ":END:" words aren't removed from the export.

> Drawers cannot contain headlines.

Do you mean it, because of the wrong export?  By wrong, I don't mean "buggy",
but "not foreseen as I (= me) thought".

Best regards,
  Seb

[1] Correct face used in the Org buffer, correct folding when TAB'ing, etc.

-- 
Sebastien Vauban




Re: [O] [babel] Purpose of :results raw

2013-04-19 Thread Nicolas Goaziou


Hello,

"Sebastien Vauban"
 writes:

> Now that ":results drawer" has been introduced, I wonder why we still have
> ":results raw".
>
> As once stated in this ML:
>
>  The sole purpose of raw results is to allow inserting an headline (I mean
>  a real headline, not comma protected) in the buffer, because headlines
>  cannot be contained in anything else than headlines.
>
> But drawer does the same. 

What makes you think drawers do the same? Drawers cannot contain
headlines.


Regards,

-- 
Nicolas Goaziou




[O] [babel] Purpose of :results raw

2013-04-19 Thread Sebastien Vauban
Hello,

Now that ":results drawer" has been introduced, I wonder why we still have
":results raw".

As once stated in this ML:

 The sole purpose of raw results is to allow inserting an headline (I mean
 a real headline, not comma protected) in the buffer, because headlines
 cannot be contained in anything else than headlines.

But drawer does the same. And drawer results can be replaced upon re-execution
(unlike raw).

So, is there still a use case for raw?

Best regards,
  Seb

PS- I could imagine that there would be a real use case if, for example, raw
did not allow "cycling" on the (tabular) results, while drawer would. But it's
not the case.

-- 
Sebastien Vauban